Thanks Peter and Ed for your suggestions. I have found a much simpler solution of achieving this functionality of user role. We have a function named: isMemberOfRole(roleId) in common.js and global.js file. I have used this function to validate the user (i have hard coded the user role to 40(site admin), which was configured in our env.). In my script i was checking for this value with other task conditions and was able to achieve my desired results. If anyone needs code snippet, please do let me know, I would be able to help.