Use GlideSecurityManager.get() to reset the user's security profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 05:42 AM
I have created this UI action, which adds the snc_read_only role to the user. The problem I'm having is that sometimes after I log out and back in - even though the role has been created in the sys_user_has_role table and is showing in the user's related roles list - it is not active, and the user can still enjoy full administrator rights. If I log out twice it works 100% correctly
the script action:
I have tried adding the GlideSecurityManager.get(); which should in theory refresh the user's profile, but it made no difference whatsover 😞
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2018 10:45 PM
The session might be still active, I guess you would need to invalidate the user session after the access is removed
Please refer this post to see on how it can be done - https://community.servicenow.com/community?id=community_question&sys_id=725587addbd8dbc01dcaf3231f9619ac
Thanks!