How to create an ACL to restrict Application/Module Access from a Role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:24 PM
Hi all,
I'm trying to restrict an application from the All dropdown menu from a certain role.
Is anyone familiar with using a script within an ACL to limit this?
Eg. A user with the 'mobile_analytics_viewer' role should not be able to see the 'Service Portal' from the all dropdown?
Any help would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 07:32 PM
Hi @Rae Khan
This can be best achieved by a Query Business Rule on sys_app_module.
The BR Should be a Query Business Rule and Advanced box is checked.
In the BR Condition check does the user have the mobile_analytics_user like gs.getUser().hasRole('mobile_analytics_viewer')
And in the Script fields add a query to filter out the application you don't want to display.
current.addQuery('sys_id', '!=', 'sys ID of the service portal module');
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 11:06 PM
Hi @Rae Khan ,
To restrict access to an application for a specific role in ServiceNow:
Click on the "Edit Application" button located next to the Application name. From there, add the specific role as demonstrated in the attached image.
Alternatively, you can go to the sys_user_role table, open the role record, and include the application along with its module to limit access, as depicted in the provided image.
If my answer solves your issue please mark it as correct ✔️ and Helpful 👍 based on impact.