ACL in CMDB

salu
Mega Guru

Hello,

I want restrict the write   and delete access for cmdb_ci table.I want to provide write   access only for when the user have cmdb_owner role or member of the assignment group of CI or assign_to of CI.

How can it achieved?

Can some one show a sample ACL for this?

Thanks

Saranya

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

You can create a table level write ACL on cmdb_ci with the following script in it.



answer = false;


if(gs.hasRole('cmdb_owner') || gs.getUser().isMemberOf(current.assignment_group) || gs.getUserID() == current.assigned_to){


  answer = true;


}





Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


View solution in original post

6 REPLIES 6

Alikutty A
Tera Sage

You can create a table level write ACL on cmdb_ci with the following script in it.



answer = false;


if(gs.hasRole('cmdb_owner') || gs.getUser().isMemberOf(current.assignment_group) || gs.getUserID() == current.assigned_to){


  answer = true;


}





Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Hello All,


Thank you for the all the help.IT works perfect


madanm7786
Mega Guru

Hi Saranya,



Create a new Write ACL and try below script.



var retn;


retn = false;


if (gs.hasRole('cmdb_owner') || gs.getUser().isMemberOf(current.assignment_group) || current.assigned_to == gs.getUserID()) {


retn =true;


}


answer = retn;


snehabinani26
Tera Guru

Hi Saranya,



See the screenshot below.



find_real_file.png



You can give the Role in Require Role section and then in script you can valiadte login user is part of Assignment group or assign to



var user = gs.getUser();


answer = (user.isMemberOf("current.assignment_group") || (gs.getUserID() == current.assigned_to) || gs.hasRole("cmdb_owner"));




See if this helps you.