Acl Restriction from incident task table to incident based on current assignment group user

vasantha Teja
Tera Contributor

Hi All, Hope you're working well!

I want ACL script and Guidelines also  If a user is part of the assignment group of an incident task, they should be able to access the incident ticket (parent) as well.

Here No specific Assignment Group and No Specific Roles For the Group members. Mainly Users haven't an "ITIL" Role. 

Name :incident_task none

operation:Read

Type: Record

script:-

if (gs.getUser().isMemberOf(current.assignment_group)) {

answer = true;

} else {

answer = false;

}

For the above script I get user's incident task Records of an part of an assigenment group only. Incident Record was not access. I got Error message Like "Record not Found". Please Help Me ASAP.

Thanks In Advance!

Teja.vasantha

6 REPLIES 6

Hi @SunilKumar_P sir, could you please provide the scripting ?

Hi @ vasantha Teja, The script below will check whether is the user member of any incident task related to that Incident. If yes, it will grant the access to the Incident table else restricts the access.

answer = false;
var grIncTask = new GlideRecord("incident_task");
grIncTask.addQuery("incident", current.sys_id);
grIncTask.query();
while (grIncTask.next()) {
    if (gs.getUser().isMemberOf(grIncTask.assignment_group)) {
        answer = true;
        break;
    }
}

 

Regards,
Sunil