How can I refresh a user session via script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2017 08:21 AM
Generally, after a user gets a new role, it seems like the session needs to restart before the system recognizes it the new permissions.
I'd like to know if I can force a user's session to refresh VIA script after they were awarded a role in the same script, so that they immediately experience the permissions granted by the role.
In other words, I have a script that essentially changes a user's role. At this point in the script, I would like to restart the user's session so that their session immediately loads with the new role.
If possible, i would like to avoid locking out their session as that causes the user to go to the log out page.
We are running Helsinki, patch 9.
- Labels:
-
Scripting and Coding
- 3,660 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2018 10:09 PM
Hi,
An undocumented way to do it is using below code.
var sm = GlideSecurityManager.get();
sm.setUser(gs.getUser());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2019 04:28 AM
Hello all,
I have the session id and user id of the user. I want to create a scripted API which will take input as session id and user and it will check it in logged in user table if the session id or user exist in return it should give me the complete details of the user from user table.
I am struggling with the script, Request you all to help me out on this it is a critical requirement.
Thanks in advance