Refresh user's Roles without logging out

Andrew Albury-D
Mega Guru

Hey everyone,

I'm looking at building an "Elevate to Admin" tool which will let our developers have a single account, without being granted Admin until they need it in Production. I've found some mentions online for a "GlideSecurityManager" API which is "undocumented" but in theory, should do what I need. (found here: https://snprotips.com/undocumented-servicenow-apis)

I am creating a "sys_user_has_role" record for a user, with the role of Admin, and would love to let them not have to log out and back in to apply these changes.

Does anyone know exactly how to use the GlideSecurityManager API? I've tried a few ways - Background script, BR on sys_user_has_role, Flow Designer Action, and none seem to work. e.g.

find_real_file.png

Any help is appreciated,

Thanks,
Andrew

10 REPLIES 10

JJ21
Tera Contributor

I've got the script wrapped in a flow triggered by a catalogue request so it will continue running and it's highly unlikely in my experience that a user will be able to log back in before the new roles have been applied.