- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 07:40 AM
Hello,
I have created a custom role ('group_admin') to enable group of members to Add/Remove group members. I modified the Omit Edit Condition (Right Click on List Header bar --> List Layout --> List Control) so only specific role person can access Edit button.
answer = (!(gs.getUser().hasRole('admin'))) || (!(gs.getUser().hasRole('group_admin')));
As per this script 'admin' role user can able to see Edit button in the group member related list but the button is not visible to the users with 'group_admin'. I have enabled the access from ACLs as well but still its not working.
Please let me know if I missed anything here.
Thanks in advance.
Regards/Rajeev Kumar
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2019 12:33 AM
Hi Rajeev,
I have tried to replicate your scenario and it worked in my personal development instance. Please modify the 'Omit edit condition' as below and make sure that the 'Omit edit button' checkbox is not selected/checked.
answer = !gs.hasRole('admin') && !gs.hasRole('group_admin');
Most importantly, there is an OOB ACL definition which restricts the creation of new Group Membership (sys_user_grmember) record if the user does not have 'user_admin' role. You may refer the below link (please replace with your instance): https://your_instance.service-now.com/sys_security_acl_list.do?sysparm_query=name%3Dsys_user_grmember%5Eoperation%3Dcreate.
So, the user must have 'user_admin' role along with 'group_admin' role for the testing purpose. If you wan to modify this condition, you better have to modify the ACL mentioned above.
Hope this helps. Please mark the answer Correct/Helpful based on the impact.
Regards,
Amlan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2019 10:42 AM
Hi Sachin,
I tried the code as per your suggestion but still no luck with the access required for. I am worried if it would be an platform issue.
Thank you.
Regards/Rajeev Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2019 01:57 AM
Hi Rajeev,
Thanks for confirming. Request you to try the code given below and let me know.
if (gs.hasRole('admin') || gs.hasRole('group_admin'))
false;
else
true;
Hope this helps. Please mark the answer Correct/Helpful based on the impact.
Regards,
Amlan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2019 10:50 AM
Hi Amlan,
I tried the code as per your suggestion and as I noticed its returning TRUE all the time. Even I tried with && operator in place of || operator but no luck with the changes.
It seems to be an platform issue as per below link I found on community but there is no update from HI.
I tried this in all the possible ways but it seems neither working for any custom role or non-admin role. I tried with itil role to check if that would work but I observed the changes are not working for non-admin roles.
Please let me know if there would be any possible solution to fix the issue.
Thank you.
Regards/Rajeev K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019 12:39 AM
Hi Rajeev,
Still you are not able to see the 'Edit' button. Hope my this understanding is correct on your issue.
If above understanding is correct, could you please confirm whether the relationship is Defined Relationship OR many-to-many/one-to-one relationship? The reason I am asking is, Defined related lists may not have an Edit button, as related records are added to these lists automatically based on the relationship between the records. Please refer this ServiceNow Docs: Configure the edit option.
For verification purpose, please navigate to the List Control of that related list and refer the field 'Related List'. For reference, I have provided snapshots of one-to-one relationship (Affected CIs on Incident form) and Defined relationship (Applications with Role on Role form). You can notice that the defined relationship contains the SysID of the relationship record.
This is the best I can guess now. Please let me know if this helps.
Hope this helps. Please mark the answer Correct/Helpful based on the impact.
Regards,
Amlan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2019 09:14 PM