Users with "Asset" role were unable to delete assets in Servicenow

divyakosaraju
Giga Expert

Hi,

Recently we observed that the users with Asset role cannot delete assets but according to Docs they should have that functionality . So not sure what is happening. 

Also few weeks back i have modified 3 UI Actions - Delete[Global] , so only admins can have the functionality to delete and all the others will not have that. Do this condition has impact on the delete button on alm_asset table. Please suggest.

Thanks,

Divya

1 ACCEPTED SOLUTION

That won't work? The users with asset role don't have the admin role I hope? So your condition will evaluate to current.canDelete() = true and gs.hasRole('admin') = false. Because it's &&, your condition is false.

Have you considered changing the ACL's or creating a custom Delete UI Action to overwrite the Global one? In out-of-the-box instances there are some good examples for an overwrite Delete UI Action. Take a look at the one for "kb_knowledge" table for example -> keypoint is the Action Name: "sysverb_delete".

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

The users with this role, is the issue they don't see the Delete UI Action (which you might have changed?). Or is the issue that they can hit the Delete button, but nothing happens/an error occurs.

Have you checked the Delete ACL for table alm_asset. Who is granted to the delete ACL?

Do the users delete the Asset thru the form lay-out or a different way?

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

They cannot see Delete Button at all.

I checked the ACl and they should be visible for the users with asset role unless the state is consumed. So for non consumable assets like , in stock the button is not visible still. PFA

 

Thanks,

Divya.

So what actually did you change to the Delete UI Action? The out-of-the-box condition is:

current.canDelete()

This actually, looks at the ACL's. Though if you changed it to something like gs.hasRole('admin') then no others will see the UI Action.

To limit who can delete, rather than changing the UI Action, change your ACL's. Or as alternative, create a custom UI Action for the specific table, with which you wish to override the Global UI Action.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

So i changed it to 

current.canDelete()&& gs.hasRole('admin');