Read ACL not working for a field

Rylie Markle
Tera Contributor

Hello, 

I am trying to get a certain group to be able to see data in the "approval_set" field. I wrote a read ACL, but for some reason the group still cannot see the data in the field. Any suggestions?

I attached screenshots of the field and my ACL below. 

 

function validate() {
    if (current.isNewRecord())
        return true;
	
	// Payroll
	if (gs.getUser().isMemberOf("765370019f22120047a2d126c42e705c"))
		return true;
	
	return false;
}
answer = validate();

 

 

6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@Rylie Markle Instead of passing the sys_id of the group, please pass the name of the group. Here is an example.

 

var currentUser = gs.getUser(); 
gs.info(currentUser.isMemberOf(­'Capacity Mgmt'));

 

Use isExplicitMemberOf method if you would like to check with a group sys_id.

 

var isExplMem = gs.getUser().isExplicitMemberOf('b8ef24616fc331003b3c498f5d3ee434');
gs.info(isExplMem);

https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server_legacy/GUserAPI#GUser-isMemberO...

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Try this

Change the function name for validate to something more Specific like validateApprovalSet()

Also Comment everything inside the function and just return true, trying to check if it is the script thats faulty or something else that might be interfering here.

-Anurag

Hello, 

I tried both and still no luck. 

Thanks, 

Rylie

Change the ACL form task to the table in question.

Are there any other ACLs on the same field?

 

How are you testing this, ill see if i can reproduce it in my PDI

-Anurag