Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 39 ยท ITSM and Administration

Users, Groups, Roles and ACLs in ServiceNow

Understand ServiceNow access control: users, groups, roles, containment, ACL rules with conditions and scripts, ACL evaluation order and testing with impersonation.

Who may see which record, and who may change which field? ServiceNow answers with a layered model. Users belong to groups, groups and users hold roles, and ACLs (access control lists) grant access to tables, records and fields based on those roles and on conditions. Understanding the evaluation rules is the difference between a secure instance and one that either leaks data or blocks everyone.

The screens described here live on an instance. The stand-ins use plain JavaScript to model the decision logic. Never test security changes on production first, and never give yourself the admin role as a shortcut.

Users, groups and roles

  • User (sys_user): a person or integration account, with User ID, Name, Email, Active, Locked out and Password needs reset.
  • Group (sys_user_group): a team such as "Service Desk" or "Network". Used for assignment, approvals and role inheritance.
  • Role (sys_user_role): a named permission, such as itil (fulfillers), itil_admin, catalog_admin, approver_user, knowledge, admin.
  • Relations: User Roles (sys_user_has_role), Group Members (sys_user_grmember) and Group Roles (sys_group_has_role). A user receives the roles of every group they belong to.

Role containment: a role can contain others. itil_admin contains itil, so holding the larger role gives you the smaller. Assign roles to groups in preference to individuals: when someone changes teams, you change only their group membership.

flowchart TD
    U["User: Beth Anglin"] --> G["Group: Service Desk"]
    G --> R1["Role: itil"]
    G --> R2["Role: knowledge"]
    R3["Role: itil_admin"] -->|contains| R1
    R1 --> A["ACL: incident.write requires itil"]

Users get roles through groups; ACLs then check the roles.

ACL rules

An ACL (System Security > Access Control (ACL)) protects one object and operation.

  • Type: record (a table or field), UI page, REST endpoint, processor, and others.
  • Operation: read, write, create, delete, report_view and a few specific ones.
  • Name: the table, or table.field, or table.* (every field).
  • Requires role: roles that grant access. Several roles mean any of them.
  • Condition: a filter on the record, such as assigned_to is (dynamic) Me.
  • Script: JavaScript that sets answer = true or false.

An ACL grants access only if all three parts pass: the role check, the condition and the script. If the role list is empty, any user passes that part.

Evaluation order

For a field, ServiceNow checks from most to least specific, and the first matching ACL that grants is enough, but a table-level ACL must also pass for the record to be accessible:

  1. The field-level ACL (incident.short_description).
  2. The table-level wildcard incident.* (field wildcard).
  3. The table-level ACL incident (row access).
  4. Parent tables' ACLs (task) walk up the hierarchy.
  5. Wildcard * and *.*.

By default the platform denies if no ACL grants access (security deny-by-default is a system property, and recent instances are shipped with it enabled). Always keep that behavior.

Example script ACL:

JavaScript
// ACL on incident, operation: write. Script:
answer = false;
if (current.caller_id == gs.getUserID() && current.state < 6) {
  answer = true;                    // callers may edit their own open incidents
}
if (gs.hasRole('itil')) {
  answer = true;                    // fulfillers may always edit
}

Row access versus field access

Table-level read ACLs decide which rows you can see. Field-level ACLs decide which columns within those rows. Users who cannot read a field see it hidden; writing is separate, so you can allow reading and block writing.

Tools for testing

  • Impersonate User (profile menu > Impersonate): act as someone else to check what they see. Return when done.
  • Debug Security Rules (System Security > Debugging): shows which ACLs were evaluated for the last transactions and why they passed or failed.
  • Elevate Role: users with the security_admin role must elevate to edit ACLs, so editing them requires deliberate action.

Principles for safe access control

  1. Least privilege. Roles grant what the job needs.
  2. Roles to groups, groups to users. Avoid person-to-role assignments.
  3. Prefer conditions to scripts, which are easier to audit and quicker.
  4. Never rely on the UI (hidden buttons, UI policies, client scripts) for security.
  5. Document the intent in the ACL description.
  6. Review roles regularly, remove inactive users, and keep few admins.

Modeling role and ACL decisions

The first stand-in resolves a user's roles through groups and role containment.

JS Stand-in: roles from groups with containment

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The second stand-in evaluates an ACL: roles AND condition AND script must pass, and deny is the default when no ACL grants access.

JS Stand-in: ACL evaluation with deny by default

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the best way to give a team a set of permissions?

    Group-based assignment is easier to maintain as people join and leave teams.
  2. 2. An ACL has a role, a condition and a script. When does it grant access?

    Role, condition and script must all pass for the ACL to grant access.
  3. 3. Which feature lets you see what another user sees to test security?

    Impersonation switches your session to another user so you can verify their access, then you return.
  4. 4. Can hiding a button with a UI policy protect data?

    UI-side changes are convenience only; ACLs enforce access on the server.

Summary

  • Users receive roles through groups; roles can contain other roles.
  • ACLs protect tables, fields and other objects by operation, and require role, condition and script to pass.
  • Evaluation moves from field to table to parent, and access is denied when nothing grants it.
  • Test with impersonation and security debugging, and follow least privilege.

Next: Update Sets, Instances and Upgrades