How to give access to a table, to a user selected on a reference field

Facundo Prado
Tera Expert

Hi everyone!
I need to give access to a user from a reference field, to a table so he can use the UI Actions to approve/reject.

This reference field is referencing to the whole users on the instance, so I can“t give perimissions to all users.

Only the user selected on this field on a ticket can acces to the modules and the ticket (only the tickets he is selected on this field).

FacundoPrado_1-1686750541471.png

I need this user (and only this user) can access to the ticket...
Any idea of how can I try this?

 

2 ACCEPTED SOLUTIONS

jcmings
Mega Sage

You'll need to create a Access Control (System Security > Access Control Logs) for whatever role you grant that user. To do this, you need the security_admin role and have to elevate permissions.

 

I'm assuming you want to grant access to the User table and not the Business approver field. In the Name field on the ACL new record screen, choose your table. (If you want to limit access to a particular field, you'll specify the field in the right-column after choosing your table; if you want them to access all fields, choose the *. I don't believe you can choose a * on sys_user though.) I believe you'll want Type=record and Operation=write. Add your role into the "Requires role" section.

 

Check out the docs on ACLs here. If you run into issues with access, you can always use the debugger (System Diagnostics > Session Debug > Debug Security). This will show you on which tables/fields access permissions fail.

View solution in original post

jaheerhattiwale
Mega Sage

@Facundo Prado you can script in the condition on ui action

current.<business approver field name> = gs.getUserID();

 

In script of ACL:

answer =current.<business approver field name> == gs.getUserID();

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

7 REPLIES 7

Great @jaheerhattiwale!! thanks for answering. I have another question related to this.
How can give access to the module of the tickets? because he needs to get into this modules to acces the ticket.
(We can“t give acces to the role to all useres, only to the user selected in this field)

@Facundo Prado scripted condition is not possible in modules. 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@Facundo Prado If the information provided is helpful then please close the thread by marking the as correct answer, so that it will help future readers.

 

Thanks

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023