How to remove Delete UI action in forms and lists

Madhan007
Tera Contributor

Hi,

I have created a table in a scoped Application.How can I hide the "Delete"UI action in both form and list with out modifying Access controls?

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @Madhan007,

 

So my response is not lost in the thread, I'm reposting here.

Having reviewed your question, as @Anurag Tripathi has outlined, best practice here is to control this via ACLs.

 

Essentially you'll need to create 2 ACL's - one for 'delete' access, and the other for 'list edit' access.

Once you've specified exactly which role can delete (eg admin, however, I would encourage you to think about other users so admins/devs become an achilles heel to the process), all users that don't have the role will not be able to delete or see the UI Action.

 

Below, I've provided an ACL on the Problem table where only users who have the 'itil_admin' or 'problem_admin' role can delete a record. If a user views a Problem without this role, they will not see the 'Delete' button (The UI Action)

Reminder, you'll need to create an ACL for both the 'delete' and 'list_edit' actions.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Robbie_0-1707227422779.png

 

 

View solution in original post

9 REPLIES 9

Madhan007
Tera Contributor

Hi @Anurag Tripathi , for some reason we were advised not to edit/create the ACL's

It is always best to ask the question 'why not' if some one mentions not to do something. As others have also pointed out: best practice to deal with the delete button, is by adjusting/creating ACL's. Do you know why that advise was given? It's against best practice at least.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Madhan007
Tera Contributor

Hi @Robbie , I tried && current.sys_class_name != 'your_table_name', it did not workScreenshot (51).pngScreenshot (52).png

Robbie
Kilo Patron
Kilo Patron

Hi @Madhan007,

 

So my response is not lost in the thread, I'm reposting here.

Having reviewed your question, as @Anurag Tripathi has outlined, best practice here is to control this via ACLs.

 

Essentially you'll need to create 2 ACL's - one for 'delete' access, and the other for 'list edit' access.

Once you've specified exactly which role can delete (eg admin, however, I would encourage you to think about other users so admins/devs become an achilles heel to the process), all users that don't have the role will not be able to delete or see the UI Action.

 

Below, I've provided an ACL on the Problem table where only users who have the 'itil_admin' or 'problem_admin' role can delete a record. If a user views a Problem without this role, they will not see the 'Delete' button (The UI Action)

Reminder, you'll need to create an ACL for both the 'delete' and 'list_edit' actions.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Robbie_0-1707227422779.png

 

 

Robbie
Kilo Patron
Kilo Patron

Hi @Madhan007,

 

Did you see my response which provides a solution?

So my response is not lost in the thread, I'm reposting here.

Having reviewed your question, as @Anurag Tripathi has outlined, best practice here is to control this via ACLs.

 

Essentially you'll need to create 2 ACL's - one for 'delete' access, and the other for 'list edit' access.

Once you've specified exactly which role can delete (eg admin, however, I would encourage you to think about other users so admins/devs become an achilles heel to the process), all users that don't have the role will not be able to delete or see the UI Action.

 

Below, I've provided an ACL on the Problem table where only users who have the 'itil_admin' or 'problem_admin' role can delete a record. If a user views a Problem without this role, they will not see the 'Delete' button (The UI Action)

Reminder, you'll need to create an ACL for both the 'delete' and 'list_edit' actions.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Robbie_0-1707385501391.png