- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 04:38 AM
Hi Swarnika,
I will make you understand in simple words.
g_user.hasRole(' ')
1. This method return true if the current logged in user has the role which we have provided in (' ') otherwise false.
2. It will always returns true if the user has the 'admin' role.
Ex: 1. Consider in the above method if you provide "itil" role and some "abc" user is loggedin to the instance and the user having 'itil' role then it returns true
2. If the user having admin role then also it returns true
g_user.hasRoles() " This method return true if current logged in user has any single role atleast.
Ex: Consider in the above method if you provide "itil" ,"service desk" roles and some "xyz" user is loggedin to the instance and the user having either of 'itil' or 'service desk' role then it returns true
g_user.hasRoleExactly(‘ ’) This method return true if current logged in user has role we which have provided in (' ')
Ex: 1. This method return true if the current logged in user has the role which we have provided in (' ') otherwise false.
2. It will returns false even if the user having 'admin' role.
Mark it correct or helpful, if it works.
Regards
Ashish