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 07:25 PM
I don't need my button to appear , it's just for hiding the 'Delete' button of[sys_ui_action]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 07:46 PM
I have few questions now. What confuses me is you have not selected where to avail 'Delete' UI action to non-admin users (ex. on form, list context menu, list choice etc). In this case this UI action will not e available to any one be it admin or non-admin.
As per your query "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? " , this to me means that you have created a delete ui action and you want your created UI to be visible/active to non-admin users and inactive to admin user.
Now if you want to make it inactive to admin users then please change the condition to " !gs.hasRole('admin') "
This will make UI action invisible to admin and visible to rest all users.
Please mark this helpful if this rings the bell and mark it correct if this resolves your issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 07:53 PM
In that case you just need to create a Delete UI Action on sys_ui_action table, please follow below steps and you should be able to achieve your requirement.
1. Find the Global Delete UI Action for Form Button and the hit Insert and Stay
2. Change the table name to sys_ui_action
3. update the condition with: gs.hasRole('admin')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 07:20 PM
Please check the suggestion which i provided and also you need to select the UI Action which you want to display or hide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2018 08:13 PM
Hello Chenyanwei,
To make a ui action inactive to admin, active to other roles you can add the following in the condition
(gs.hasRole('admin') == 'false')
Also consider that the global Delete button uses "current.canDelete()" as a condition, so to hide it make sure the current user doesn't have deletion rights (look at the ACLs of the table).
Regards