create a read ACL without providing role to group

Cindy Sim
Tera Expert

Is there a way to create read ACL on Project  tables for a particular group ABC without giving the group any role so that they have can view projects from dashboard and application module.

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @Cindy Sim 

yes this is possible. Instead of selecting any roles in the ACL enter into the script field something like that

answer = gs.getUser().isMemberOf('REPLACE WITH YOUR GROUP NAME');

Maik 

Cindy Sim
Tera Expert

@Maik,

thanks for reply. I have above script on my ACL the user in that group are able to view the projects but do not have access to some reports on dashboards. I need ACL that provides access to all the reports on dashboard. and when user click on the report it would take them to respective table without having to add any role to the group. 

Tai Vu
Kilo Patron
Kilo Patron

Hi @Cindy Sim 

When it comes to Reports and Dashboards, it's necessary to share them with the Group to grant them the ability to view it.

Timi_0-1705467611270.png

Timi_1-1705467658817.png

 

Additionally, we should have an ACL report_view with the same script as Maik.

Timi_2-1705467747232.png

 

Cheers,

Tai Vu

sourav1999
Mega Guru

Yes, you can create a read Access Control List (ACL) on Project tables for a particular group without giving the group any role. Here are the steps:

 

1. Navigate to "System Security > Access Control (ACL)" in ServiceNow.
2. Click on "New" to create a new ACL.
3. In the "Name" field, enter a name for the ACL.
4. In the "Type" field, select "Record".
5. In the "Operation" field, select "Read".
6. In the "Admin Overrides" field, select "No".
7. In the "Table" field, select the Project table.
8. In the "Requires Role" field, leave it blank.
9. In the "Advanced" field, write a script that checks if the user is a member of the group ABC. Here is a sample script:

javascript
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', gs.getUserID());
gr.addQuery('group', 'ABC'); // Replace 'ABC' with the sys_id of the group
gr.query();
return gr.hasNext();
})(current, previous);


10. Click on "Submit" to create the ACL.

 

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - nowgpt.ai