
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 01:07 AM
Hi everyone.
When creating view rules, I'd normally go for hasRole to specify a view for an ITIL user for example.
But, how do I target users who have no roles, in my scripts?
Is it hasRole('NULL'), hasRole($null) or perhaps hasRole('')?
Or is it better to use a fourth way?
Solved! Go to Solution.
Labels:
- Labels:
-
Scripting and Coding
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 01:17 AM
Here:
how to check for null roles using gs.hasRole() function
gs.getUser().getUserRoles().toArray().length==0 //this means current user does not have any roles.
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2017 01:20 AM
Awesome, thanks!