Relationship between cell context menu UI actions and "Requires role"

bonsai
Mega Sage

I want the UI actions displayed in the cell context menu to be visible only to admins.

I set the "Requires role" for the UI action to admin, but it was not hidden.
Is this not possible to use this on the list screen?

2 ACCEPTED SOLUTIONS

@bonsai 

then don't touch the OOTB UI action

Ensure you override that for your custom table

1) open the OOTB one

2) change the table to your custom table

3) add this in condition

current.canWrite() && gs.hasRole('admin')

4) Right click form header and "Insert and Stay"

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

Hey @bonsai , You can try the method suggested by @Ankur Bawiskar .

When I was trying to recreate this in my PDI, I used the 'UI Action Visibility' option from the related lists. I added 'Admin View' to the list, and that helped hide the UI Action to other non-admin users. You might want to try that too, if it works for what you need.

View solution in original post

11 REPLIES 11

Test the task with an extended custom table.

Hey @bonsai , You can try the method suggested by @Ankur Bawiskar .

When I was trying to recreate this in my PDI, I used the 'UI Action Visibility' option from the related lists. I added 'Admin View' to the list, and that helped hide the UI Action to other non-admin users. You might want to try that too, if it works for what you need.