Access controls are a security aspect of ServiceNow, and whether access is given is mainly governed by configured roles. However, if a more complex calculation as to whether users are allowed access is required, we need to use script to account for this.
Generally, access controls are defined without the need for scripting, but there are still a fair amount of scenarios that require code to be used. These are often when information about a user is needed further than their roles; for example, their group membership or company.
To amend access controls, you need to have the security_admin role and ensure that you elevate privileges and use it before trying to make changes to them. To get to the scripting aspect of an access control, you need to tick the advanced checkbox. Once this is done, the script field will appear at the bottom of the form.
For each access...