ACL for an individual user

Adam Peterson
Kilo Sage

I have a read ACL for a field so two different roles can view it and others can't. I need to add 1 individual to view this field. Is there a way to do this in the ACL script area? I tried different answer = gs.getUser()...etc but came out with no luck.

Thanks in advance!

1 ACCEPTED SOLUTION

I think, this is more standard way. Tomorrow you may have additional users who would want access to that field. So instead of hardcoding one user, it is best practice to create a role and assign it to that user

View solution in original post

7 REPLIES 7

Please mark the response and close the thread if it answered your question.

Prateek kumar
Giga Sage

Why create a role, instead create a group and use gs.getUser().isMemberOf('GroupName');

If in future more users needs access to this field, just add them to this group.

Adam Peterson
Kilo Sage

And like others have said - this is not best practice because you never want to hard code a user in but I did figure something out using their sys_id:

 

if (gs.getUserID() == "fd42c5620fa8b500250a937f62050e53" || gs.hasRole("operations_support") || gs.hasRole("customer_service")){
	
	answer = true;
}