Difference between gs.hasRole(‘abc ’)and gs.getUser().hasRole(‘abc’) if I want to use in acl script

Vasavi4
Giga Contributor

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. 

8 REPLIES 8

Thank you

Saurav11
Kilo Patron
Kilo Patron

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

Vasavi4
Giga Contributor
Thank you

Hello,

If my answer helped you, can you also mark it as correct.

Thanks.