Help with ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2025 07:27 PM - edited 09-10-2025 07:32 PM
Hi Team,
I have created one custom role, and I want to provide read and write access to this role for all tables in servicenow.
I have created scripted rest api. In Default ACL, I am using custom ACL:
Type: REST_endpoint
Operation: excute
Application: Custom application
Active: true
Decision Type: Allow if
Admin override: true
Protection Policy: None
Name: ACL for Custom API
Requires Role:
- rest_api_explorer.
As informed by ServiceNow support, we should use other roles as well in ACL other than rest_api_explorer. So, planning to use custom role. I want to add custom role which has read and write access for all tables becuase scripted rest api has GlideRecordSecure.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2025 07:40 PM
Hi @VirendraKuD
Granting “read & write on all tables” to a single role is almost the same as giving admin.
- This is not recommended unless you are working in a dev/test environment.
- In production, best practice is least privilege: only grant access to the exact tables your Scripted REST API needs.
That said, let me explain better the possible approach
If you want your custom role (say, x_custom.api_user) to only access the tables your REST API needs:
- Go to System Security > Access Control (ACL).
- Create ACLs for each table (and operation: read, write, create, delete).
- Add your custom role to Requires Role.
- Example: incident.read → Requires role = x_custom.api_user.
- Example: incident.write → Requires role = x_custom.api_user.
- In your Scripted REST API, assign this role (x_custom.api_user) to the resource.
This way, your role can only touch the needed tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2025 08:12 PM
Can I create these ACLs in scoped application. Because I have one system table - sys_translated. Can I create read role for this table from scoped app.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 12:47 AM
Scoped applications can create ACLs only for tables in their own scope (e.g., x_yourapp_table).
If you try to create an ACL in your scoped app for a system/global table (like sys_translated, sys_user, incident, etc.), ServiceNow won’t let you — those ACLs live in the global scope.
Why? Scoped apps are meant to be modular and not interfere with global/system security.
Only global ACLs can control access to system tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2025 01:17 AM
Hi @VirendraKuD
-
ServiceNow doesn’t allow you to simply “give a role access to all tables” with one click.
-
By default, table security is enforced through ACL rules.
-
Since your Scripted REST API uses GlideRecordSecure, ACLs will always be checked
If your goal is:
“A custom role that can call my Scripted REST API and access specific data inside it”
Then:
-
Create a custom role, e.g., x_myapp.api_user.
-
Add that role to your REST Endpoint ACL (rest_endpoint ACL → Requires Role = x_myapp.api_user).
-
Create table-level ACLs for each table the API needs to touch (incident, sc_task, cmdb_ci, etc.).
-
Read: x_myapp.api_user
-
Write: x_myapp.api_user
-