Only users with the admin role should have the ability to add and remove checklist_items.

MayurGavhane
Tera Contributor

 

Hi All,

I'm using a checklist on my incident form, but I don't want non-admin users to be able to add or remove items(checklist_items).

I tried using the UI macro (inline_checklist_macro) script, but it made all the checkboxes ready-only.

Also can we create report using these checklists.

 

MayurGavhane_0-1691082739498.png

 

@Ankur Bawiskar 

@Ravi Chandra_K

@Samaksh Wani  

 

 

1 ACCEPTED SOLUTION

sushantmalsure
Mega Sage
Mega Sage

Hi @MayurGavhane 

This can be done by adjusting the create ACL present on checklist table.

OOB ACL is present here : https://<instance>.service-now.com/sys_security_acl.do?sys_id=0a3ac670c30202004e44dccdf3d3ae52

 

replace instance with your instance name.

 

Remove the role (if any) and in script just write : answer = false; and keep admin overrides to true.

Now this ACL will only allow admins to create new checklist items and keep new items creation from non-admin users.

 

Do check if there are any other create() ACLs present on checklist table to make sure non-admin should not have access to create. 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

View solution in original post

10 REPLIES 10

nameisnani
Mega Sage

Hi @MayurGavhane  ,

 

To restrict who can add and remove checklist_items, you can use the following steps:

  1. Go to System Definition > Tables > checklist_item.
  2. Click the ACL tab.
  3. In the Write permission, click Edit.
  4. In the User Roles section, add the admin role.
  5. Click Save.

This will restrict all users except for admins from adding or removing checklist_items.

The UI macro (inline_checklist_macro) script will make all the checkboxes ready-only, but it will still allow users to add or remove items. To prevent this, you can use the following code in the script:

if (user_has_role("admin")) {
  // Allow admin users to add and remove items.
} else {
  // Disable the add and remove buttons for non-admin users.
  checklist_item_add_button.disable();
  checklist_item_remove_button.disable();
}

This code will check the user's role and disable the add and remove buttons for non-admin users.

Yes, you can create reports using checklists. To do this, you can use the following steps:

  1. Go to Reports > Create Report.
  2. In the Select a report type section, select Checklist.
  3. In the Select a checklist section, select the checklist that you want to create a report for.
  4. Click Next.
  5. In the Report definition section, configure the report settings.
  6. Click Create.

The report will be created and you can view it in the Reports list.

 

Please mark the answer as correct solution and helpful if helped.

sushantmalsure
Mega Sage
Mega Sage

Hi @MayurGavhane 

This can be done by adjusting the create ACL present on checklist table.

OOB ACL is present here : https://<instance>.service-now.com/sys_security_acl.do?sys_id=0a3ac670c30202004e44dccdf3d3ae52

 

replace instance with your instance name.

 

Remove the role (if any) and in script just write : answer = false; and keep admin overrides to true.

Now this ACL will only allow admins to create new checklist items and keep new items creation from non-admin users.

 

Do check if there are any other create() ACLs present on checklist table to make sure non-admin should not have access to create. 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

@sushantmalsure , Hi Sushant, i am trying this ACL, but this ACL is on global table but my table that is having check list is on scoped application, where my requirement is like Need to restrict "Add Item" icon in check list based on roles/groups. 

Could you please guide more.

MayurGavhane
Tera Contributor

Dear @sushantmalsure @nameisnani I changed the ACL above, and it's partially functional now.

However, when I impersonate to an ITIL user, I can still see the "add Item" option, but when I try to save then checklist option vanishes.

 

MayurGavhane_0-1691087244688.pngMayurGavhane_1-1691087281659.png