Field level ACLs creation options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 04:03 AM
I have field-level ACLs defined on a table, and I noticed entries like tablename.* exist for read and write operations. Initially, I used GlideRecordSecure in my script to rely on built-in ACL enforcement.
However, I observed that GlideRecordSecure can result in unexpected behavior during operations like insert() or update() — for example, if the user lacks access to some fields, only a partial insert may happen (i.e., some fields are saved while others are silently skipped). This is not desirable, as it leads to inconsistent data.
To ensure strict enforcement of field-level permissions, it's better to explicitly validate field access and throw an error if the user doesn't have permission to access any of the required fields — instead of proceeding with incomplete data.
While we can use isValidField() to check field access or gr.getElement(fieldname).canRead(), calling it for each field individually becomes tedious. Even if we centralize this in a helper method and pass a list of field names, we still have to maintain that list for all usage points, which is error-prone and difficult to scale.
Any other way to handle this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 01:52 AM
Hi @Ankur Bawiskar ,
using gliderecordsecure id field's value always gets returned? doesn't matter if it respects acl or not? i have observed this for few tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 02:03 AM
GlideRecordSecure I believe is only for record and not for field
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 02:07 AM
I have verified this , for the fields not accessible, it's returning null/default value except id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 02:25 AM
So my above guess is correct.
In that case you cannot use GlideRecordSecure for field access check
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader