Assignment of a role to a user only active after logout login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 06:23 AM - edited ‎01-08-2024 06:24 AM
Hi,
user is active and logged in (active session)
i assign this user a role during that session
Normaly user has to logout and log in again to have that new "Permission".
Is there an option to "activate" that new assigned role without logout ?
So that the user has no action and "feels/see" no action?
Something like, GlideSessions.loadnewroles(); ? 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 06:26 AM
Hi @Meloper ,
Unfortunately NO, the user has to do that bit at minimum for the role/ permission to be allocated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 02:04 AM
GlideUser object update
There is a common business requirement to update users roles dynamically without asking them to re-login. Well-known solution using GlideSecurityManager will help only partially because it will not refresh GlideUser object. As a result method gs.getUser().hasRole('itil') will fail (will check against "old" list of roles). Solution is available down below. Big "Thank you" goes to @icerge.
var user = gs.getUser(); // Refresh GlideSession object GlideSecurityManager.get().setUser(user); // Refresh GlideUser object gs.getSession().loadUserByID(user.getID());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 06:27 AM
Hi @Meloper
Are you talking about elevated role?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************