Trouble adding read access to sys_user_group for no role users

McGuire6799
Tera Contributor

Hello-

I have added an ACL for the sys_user_group to have read access to the table. I have a catalog item with a reference to this table to allow users to select the required support and approval group for a business application. I cannot get this to field to populate any options for a user with no roles. ITIL and Admin can see them just fine. I have added the below script to the advance section as well as I have previously done for another table.

if (gs.getUserID() == current.sys_id || gs.getUser().hasRoles())
answer = true;
else
answer = false;

1 ACCEPTED SOLUTION

vkachineni
Kilo Sage
Kilo Sage

Can you try with just

answer = true;

You are only giving read access to Name field. You can add conditions later.

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

View solution in original post

15 REPLIES 15

Allen Andreas
Administrator
Administrator

Hi,

Sorry, your script doesn't really make sense. Please review that?

Your script is saying if the current user's ID equals the current record's sys_id? That would never happen or the current user has any role at all, which also wouldn't happen because you said they have no rules?

You leave the roles section empty and the script section empty as well and just have it as a read ACL, additionally you could also try using script as:

answer = !gs.getUser().hasRoles();

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Unfortunately both of these methods still return no results.

Hi,

Sorry. Can you actually show what you've done? An entire screenshot of your ACL and the script section, etc.?

What I've mentioned is pretty basic and should work and is prescribed from ServiceNow as mentioned here: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0720034

If you don't mind, can you give more back to the post than just saying it doesn't work?

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello-

Here is the two parts of the ACL (on my laptop so can't fit it all on the screen or zoom out enough)

find_real_file.pngfind_real_file.png