Read, write and report ACL will be created for assignment group type= IT Service

Pratiksha KC
Kilo Sage

I wants to create a Read, write and report ACL  for assignment group type= IT Service, Exception: Admin

 

When agent selects any other Category/Subcategory, but the ticket is assigned to a group of type: IT Service, the ticket should ONLY be visible for members of groups that have type: IT Service.

 

I have created a read and write ACL: incident.*

 

script - 

answer = false; // Deny by default

// Always allow admin
if (gs.hasRole('admin')) {
  answer = true;
}
else if (current.assignment_group) {
  var group = current.assignment_group.getRefRecord();

  if (group.isValidRecord()) {
        if (group.getValue('type') == 'fb1b6d20c3612e1052a8f8bc7a01315c') {
   
      var gr = new GlideRecord('sys_user_grmember');
      gr.addQuery('user', gs.getUserID());
      gr.addQuery('group.type', 'fb1b6d20c3612e1052a8f8bc7a01315c'); // sys_id of type- IT service
      gr.query();
      answer = gr.hasNext();
    } else {
     
      answer = true;
    }
  }
}
 
PratikshaKC_0-1748877274945.png

 

PratikshaKC_1-1748877316044.png

 

2 ACCEPTED SOLUTIONS

Chaitanya ILCR
Giga Patron

Hi @Pratiksha KC ,

 

use deny Unless type acl or query BR for this

 

deny unless acl 

replace itil with it services in the condition

ChaitanyaILCR_2-1748952179483.png

 

ChaitanyaILCR_1-1748952095440.png

script

answer = gs.hasRole('admin') || gs.getUser().isMemberOf(current.getValue('assignment_group'));

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

View solution in original post

Pratiksha KC
Kilo Sage

Thanks for the replies. @Chaitanya ILCR , @Ankur Bawiskar , @Rakesh18081 

It simply worked with applies to condition. Got the solution. 

 

PratikshaKC_0-1748962806271.png

 

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron

@Pratiksha KC 

so what debugging did you perform?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Hi @Ankur Bawiskar 

 

Not able to achieve the goal. 

Even if I assigned the incident to group who have that type, it is still accessible for all the user.  

@Pratiksha KC 

so which ACL is allowing the access?

Any other ACL?

If my response helped please mark it correct and close the thread so that it benefits future readers.

@Ankur Bawiskar 

OOB ACL for incident table.