how to make the ui action be inactive except to admin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 06:32 PM
I create a ui action and the action name is delete_checked to hide the 'Delete' ui action of table[sys_ui_action] in my table .but how to make my ui action inactive to admin, active to other roles?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 06:37 PM
You can add below in condition to have the UI Action enable only for admins,
gs.hasRole('admin')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 06:39 PM
Hello Chenyanwei,
You can use condition of the ui action and specify the condition "gs.getUser().hasRole('admin')".
When you do this it means that show this UI action only if the user has admin role else hide this.
Please mark this helpful if this rings the bell and mark it correct if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 07:09 PM
I tried and it didn't work as I supposed either:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 07:17 PM
Hi Chenyanwei,
The issue I can see from your screen shot is, you have not checked "Form Button" that's why it is always hiding.
Please check the check box as per your requirement and then test.
Please mark this helpful if this rings the bell and mark it correct if this resolves your issue.