- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 10:31 PM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 10:40 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 10:40 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 11:59 PM
Hello All,
Thank you for the all the help.IT works perfect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 10:43 PM
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2017 10:43 PM
Hi Saranya,
See the screenshot below.
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.