ACL evaluation in script for roles, not current user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:24 AM - edited 04-24-2025 04:04 AM
Hi,
Use case end goal: Create a CSV file in format below to capture for each group access per table in the system. See format below.
Group Name | table1 | table2 | table3 | table4... |
Group1 | CRD | CRUD | R | RUD |
Group2 | CRUD | CRUD | CRUD | CRUD |
Group3... | R | R | RU | - |
For that I would need some way to evaluate ACLs for a role in code.
Available inputs: group, roles (for that group), table name to evaluate against.
Do you know any baseline script include I can use? All I see use current user which is not what I want.
Edit clarification:
new GlideRecord(tableName).canWrite() or .canRead() would work well but only for current user. Impersonating group users would be possible via script however not all groups have at least 1 user.
GlideSecurityManager.hasRightsTo also works for the current user only.
Should I just add one dummy user to the group if empty, use one if not empty, impersonate that user and check if they can access certain tables? What is your recommendation?