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

Ramesh Lohar
Kilo Guru

Yes, you can create an Access Control List (ACL) on the Project table for a specific group without assigning any roles to the group. Here are the steps:

1. Navigate to "System Security > Access Control (ACL)".
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 "Project" (or the specific project table you want to apply the ACL to).
8. In the "Requires Role" field, leave it blank as we don't want to assign any roles.
9. In the "Advanced" field, write a script that checks if the current user is a member of the group ABC. Here is a sample script:

javascript
(function executeRule(current, previous /*null when async*/) {
var grp = new GlideRecord('sys_user_group');
grp.addQuery('name', 'ABC');
grp.query();
if (grp.next()) {
var grpUsers = new GlideRecord('sys_user_grmember');
grpUsers.addQuery('group', grp.sys_id);
grpUsers.addQuery('user', gs.getUserID());
grpUsers.query();
return grpUsers.hasNext();
}
return false;
})(current, previous);


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

This ACL will allow users in the group ABC to read records from the Project table without having any specific roles. They can view the projects from the dashboard and application module.


nowKB.com