Hi Everyone,
I am new to OutSystems. I am trying to get all roles for logged-in user and save them somewhere (maybe client variables or please suggest how to save this info on client side) to use throughout application (instead of checking on each page).
How can I achieve it in best possible way (maybe after login). I am working on O11.
Regards,
Rahul Singhal
Hi @Rahul Singhal
You can achieve it by these two system entities - Role & User_Role
and apply these two filters
I hope it'll help you.
ThanksDeep
Hii @Rahul Singhal,
I have applied the requirements that you want on login, on the screen and saved the name of the roles of login user.
Hope it will helps you. You can ask for any other query you have.
Thanks,
Rounak Rawat
Thanks a lot @Rounak Rawat. Worked like a charm. Made just 1 change, used a switch in loop to set Boolean client variables for each role.
I am glad it worked for you, if you need anymore help you can ask me.
Rounak Rawat.
There is a system entity called User_Role in the System Module. You can use Aggregate or SQL to get it.
Thanks @Kiet Phan. Only change is that column names are Role_Id and User_Id in User_Role entity.
Hi,
Using User_Role is NOT correct! You need to use User_Effective_Role which is a view that only includes roles that a user indirectly has through a User_Group assignment.
Daniel