I want to hide a button (UI Action) from users with a certain role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2014 01:50 PM
In the condition of the UI Action, I currently have the following code: current.canCreate() && !RP.getListControl().isOmitNewButton() && !RP.isRelatedList()
I would like to keep anyone who has the role of auditor from seeing this UI Action (button), so I added: && !gs.hasRole('auditor')
The entirety of the condition is now: current.canCreate() && !RP.getListControl().isOmitNewButton() && !RP.isRelatedList() && !gs.hasRole('auditor')
I assumed that this would mean, that for a user to see this, they would have to not have the role of auditor. But when I impersonate an auditor, I still see the button.
What am I doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2015 07:39 AM
Vaibhav,
Have you tried something like this?
( (!gs.hasRole('asset_viewer') && !gs.hasRole('role_2') && !gs.hasRole('role_3') )|| gs.hasRole('admin'))
In this case it will be hidden from roles; asset_viewer, role_2, role_3. Notice the parenthesis around the roles that you want to block.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2015 11:15 PM
Hi Eric,
Thanks for the quick reply.
But issue i am having is,I just want to hide button from asset_viewer role.Other roles can see it.I can't put each and every role in that condition.
And i am not able to understand why this "!gs.hasRole('asset_viewer')" condition is not working for me. It should work.