Evaluate Current Logged in User in ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 10:14 AM
Hello I am trying to write a acl where the Current logged in user can only read the records if their department has a district code of "FLO". The field would be user.department.u_district. How can I evaluate if that is true in a ACL?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2023 10:25 AM
Hi @Nic Omaha
you can have advanced checkbox as true on the Read ACL for the table.
and you can write script as below:
answer = checkDept();
function checkDept(){
var grUser = new GlideRecord("sys_user");
if( grUser.get(gs.getUserID()){
if(grUser.department.u_district == "FLO"){
return true;
}
}
return false;
}
Aman Kumar