ACL to restrict "write" to a group

lakshmidurga
Tera Expert

Hi All,

I am trying to write an ACL,which defines the incidents should be editable only to a particular group.I wrote the below ACL but it is not working.

Please correct me if I have done something wrong

function inc(grp,prio)

{

var usr = gs.getUserID();

var grp = usr.isMemberOf();

if(grp =='77a8880adbc932002c98d540cf9619c0')

  {

  return true;

  }

  else

  {

  return false;

  }

}

Thanks in advance.

8 REPLIES 8

Hi Mihir,



I used the below script



Name   : Incident *


conditions : Priority is one of Critical or high



Script:



function inc(grp,prio)


{


if(gs.getUser().isMemberOf('MIM'))


  {


          return true;


  }


  else


  {


          return false;


  }


}


Just add this in the script editor.Then MIM group members can only edit the incident fields.



if(gs.getUser().isMemberOf('MIM')) {


  answer = true;


}


else{


answer = false;


}



Thanks,


Mihir


We have an ACL which allows all the write permission to all fields if it is not closed.I marked it as inactive.



Now it is working exactly opposite


If the user is from non-MIM group he is not able to edit any incident


If the user is from MIM group,Ha can edit Critical and High priority incidents but not able to edit other priority incident.



Thank you.


shloke04
Kilo Patron

Hi,



You can implement a Write ACl on Incident table at the field level with the below script as:



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


  answer = true;


}


else{


answer = false;


}



Incident ACl.png



Hope this helps. Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke