Restricting view of Incidents (ACL)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 08:12 AM
Hello Community,
The Incident form has a lot of ACLs, However I need to lock down All HR Incidents to users with an HR Role...I've put the following in for a Read ACL, however it locks everyone out of the Incidents
if the "Functional Area" = Human Resources I want to restrict those Incidents to only users with that role
ACL Script:
current.u_functional_area = 'HUMAN RESOURCES';
Requires Role:
HR
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 08:19 AM
Use this script only in Read ACL
if(current.u_functional_area = 'HUMAN RESOURCES' )
{
if(gs.hasRole('HR'))
answer=true;
else
answer=true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 09:14 AM
Hi Anurag,
I get the following,
WARNING at line 1: Expected a conditional expression and instead saw an assignment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 09:17 AM
You will have to use '==' when you are comparing inside the if condition
Change to this "if(current.u_functional_area == 'HUMAN RESOURCES' )"
thanks,
Abhinay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 09:17 AM
if(current.u_functional_area == 'HUMAN RESOURCES' && gs.hasRole('HR')){
answer = true;
}
else{
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 08:20 AM
Hi Jason,
Try like this, remove the requires role record.
In the script section
if(current.u_functional_area = 'HUMAN RESOURCES' && gs.hasRole('HR')){
answer = true;
}
else{
answer = false;
}
I believe "u_functional_area" is a String/Choice field.
Please mark it this helpful/correct if you were able to solve the issue.