delete button should be hidden for particular roles.

siva58
Tera Contributor

Hi all, 

my requirement is i need to hide Delete button for the particular roles.

ex: the user who has the test_manager, test_stall,  role they was not able to  see the Delete button.

1 ACCEPTED SOLUTION

Hi,

there should be 1 table level DELETE ACL

Search for that and add appropriate roles

Regards
Ankur

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

View solution in original post

12 REPLIES 12

Mohith Devatte
Tera Sage
Tera Sage

Hello ,

In the UI action condition you can write the below piece of code!

!gs.hasRole('test_manager')||!gs.hasRole('test_stall') 

this will restrict the UI action visibility for the users who have above two roles.

Thanks,

Mohith.

 

Please mark helpful if this answers your questions

@Mohith Devatte . thanks for helping.

 

but this UIAction written for Global table. it cause any issue?

then i suggest do not touch it because it might solve your issue but touching OOB things is always risky.

Try using ACL's for this.

Create a Delete ACL and give roles who can only delete the record this will automatically solve the issue and will hide the button  for users who don't have roles mentioned in that delete ACL

please mark this helpful if it answers your question.

@Mohith Devatte  how to create  ACL for Button