- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 06:19 AM
Hello all,
I have a requirement, in a list view, I want to make a field (u_enable) editable to only one Assignment group,
On the form view, I have written a UI policy to show the 'Enable' field and make it mandatory, if the Assignment Group is some abc group.
But in the list view, every other Assignment group is able to Edit the field.
So, please help me on, the field can be visible on the list view, but other than abc assignment group, no other group can edit it.
Please help me how can I do this?
Regards,
Lucky
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 07:31 AM
Hi @Lucky1,
I've tweaked the script for you. This should work. It's tried and tested on my PDI.
answer = checkUser();
function checkUser(){
if (gs.getUser().isMemberOf('62826bf03710200044e0bfc8bcbe5df1')) { //replace the sys_id with your assignment group
return true;
}
else{
return false;
}
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 06:25 AM - edited 08-09-2024 07:06 AM
@Lucky1 create a ACL to restrict editing of the field to only the specified group (abc) in the list views.
var answer = false; // Default value
if (gs.getUser().isMemberOf('5f6441efc0a8010e0177fcb589156352')) { //replace the sys_id with your assignment group sys)D
answer = true; // Set to true if the user is a member of the specified group
}
…………………………………………........................................................................................
Mark it helpful 👍and Accept Solution ✅!! If this helps you to understand.
…………………………………………........................................................................................
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 06:32 AM - edited 08-09-2024 07:29 AM
Hi @Lucky1,
This is very easily achieved with an ACL of type 'list-edit'.
To implement this:
- Elevate your role as 'security_admin'
- Create new list edit ACL on the table you have created your 'u_enable' field on
- If you want to ensure not even admins can override this ability, check the 'advanced' checkbox as true
- Within the script section:
answer = checkUser();
function checkUser(){
if (gs.getUser().isMemberOf('62826bf03710200044e0bfc8bcbe5df1')) { //replace the sys_id with your assignment group
return true;
}
else{
return false;
}
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 07:06 AM
Hello Robbie,
I have written ACL like
list-edit ACL on Incident - Enable
Roles: ITIL
Script:
if(gs.getUserID().isMemberOf('sys_id_of_a_group'){
gs.log("Logged in user is "+gs.getUserID());
answer = true;
}
else
{
answer = false;
}
But, the log itself is not coming.
I checked and the user is part of the Assignment group mentioned in the isMemberOf
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 07:17 AM
@Lucky1 replace your if condition with if(gs.getUserID().isMemberOf('sys_id_of_a_group')
Please Mark it helpful and Accept Solution!! If this helps you!!