Difference between gs.hasRole(‘abc ’)and gs.getUser().hasRole(‘abc’) if I want to use in acl script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 08:19 AM
Difference between gs.hasRole(‘abc ’)and gs.getUser().hasRole(‘abc’) if I want to use in acl script. Which one is better. I saw same functionality when using both ways. Please suggest.
- Labels:
-
Case and Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 08:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 08:45 AM
hello,
As you yourself saw in the above case both can help you achieve your goal of hasrole
Also there is no documentation of which one is better than the other.
However when look at OOB ACL 90 percent of them using the hasrole syntax is using the below:-
gs.hasRole(‘abc ’)
So I believe you should also follow the same.
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 08:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 08:52 AM
Hello,
If my answer helped you, can you also mark it as correct.
Thanks.