Create ACL
create_aclCreate ServiceNow ACLs with roles, conditions, or scripts, write them to a specified update set, and verify each change; confirm user approval first because this is a security change.
Instructions
Create an access control. This is a security change: before calling it, tell the user who gains or loses access and get their go-ahead. It elevates its own session to security_admin (only for ACL tools; other tools stay unelevated) and writes into the named update set, verifying each write by reading it back. With roles, the ACL is inserted inactive, given its roles, cleared of the snc_internal role the platform adds to a role-less ACL, checked, and only then activated. Without roles, snc_internal stays and every internal user who meets the condition or script passes. Put an ACL in its table's application: the platform's documented limits allow only role-based field ACLs on another application's table.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Other types: the resource name (UI page, REST endpoint, script include, ...). | |
| type | No | sys_security_type name. Default record. | |
| field | No | Record ACLs: the field, or * for every field. Omit for the table itself. | |
| roles | No | Role names; any one of them passes the ACL. Omit (not []) for an ACL decided by its condition or script alone. | |
| scope | No | The ACL's application: its scope name (e.g. "x_acme_app"), or "global". Give this or scope_id. | |
| table | No | Record ACLs: the table. | |
| active | No | Default true. false creates it inactive. | |
| script | No | Script that sets `answer`. Also turns on advanced, so the form shows it (the platform runs it either way). Code on an ACL runs on the instance at every check, so setting it needs permission to run code as well as to write. | |
| instance | No | The ServiceNow instance auth alias to connect to. This is the alias configured via `snc configure` (e.g., "myinstance", "prod", "test"). The user will typically refer to this by name when saying things like "on my myinstance instance". If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| scope_id | No | The ACL's application by sys_scope sys_id, instead of scope. | |
| condition | No | Encoded query condition the record must meet. A javascript: value in it is code: it needs permission to run code as well as to write. | |
| operation | Yes | Operation name: read, write, create, delete, execute, ... | |
| update_set | Yes | sys_id of an In progress update set of that application (create one with create_update_set). Every write is captured there and verified; the user's own current update set is left as it is. | |
| description | No | Description. The platform may write its own on first save. | |
| decision_type | No | allow (Allow-If; create_acl default) or deny (Deny-Unless: checked first, grants nothing on its own). update_acl: omit to leave it. | |
| admin_overrides | No | Whether admin passes regardless (the form's Admin overrides). create_acl default: true; update_acl: omit to leave it. | |
| acknowledge_upgrade_skip | No | Only for an installed Store application, and only after the user has reviewed it: upgrades of that application then skip this ACL until the customization is reviewed. |