# Set User Role at runtime

**URL:** <https://forum.inductiveautomation.com/t/set-user-role-at-runtime/8559>\
**Category:** Ignition\
**Created:** [June 12, 2014, 7:40pm UTC](https://forum.inductiveautomation.com/t/set-user-role-at-runtime/8559 "2014-06-12T19:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdafonseca](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cdafonseca](https://forum.inductiveautomation.com/u/cdafonseca)\
**Post date:** [June 12, 2014, 7:40pm UTC](https://forum.inductiveautomation.com/t/set-user-role-at-runtime/8559/1 "2014-06-12T19:40:00Z")

</div>

Hi Guys!  
I’m using a AD/Database Hybrid User Source, I require to set the User Role based on the AD Group the user belongs to. I could get the User data from AD using the system.security.getUserRoles() script function, but I didn’t found how to set the user role at runtime, I mean, after login. Is it possible?

Thank you in advance!

Claudio

---

<div class="post-metadata">

**Author:** ![cdafonseca](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cdafonseca](https://forum.inductiveautomation.com/u/cdafonseca)\
**Post date:** [June 12, 2014, 8:35pm UTC](https://forum.inductiveautomation.com/t/set-user-role-at-runtime/8559/2 "2014-06-12T20:35:09Z")

</div>

And what about to refresh the current user profile once the User data get updated after he/she is already logged in?
