1 Reply · Latest reply on Nov 30, 2017 10:41 PM by Gaurav Bajaj

    Dynamic Role creation?

      Hi All,


      i have a level field, depends on level is it possible to allocate the role dynamically without creating the group??


      i dont want to create a group and assign the role to group, i need to allocate the role depends upon level is it possible?

      please help me in this scenario.




        • Re: Dynamic Role creation?
          Gaurav Bajaj

          Hi Venkat,


          You can try adding a business rule on sys_user table.

          As soon as a record is set and level is added there, you can pick the level value and decide which roles you need to add to the user,


          Just Query down sys_user_has_role table and try below script in the BR.



          var gr = new GlideRecord('sys_user_has_role');


          gr.user=current.sys_id; //sys_id of the user

          gr.role="add sys_id of the role";






          Please mark the response correct/helpful based on the impact.