25
Views
4
Comments
Is there a way to add user roles and have it be reflected in an active user session?
Application Type
Reactive

Scenario 1

User requires a role to access a page. User currently has the role and can access the page.

I removed the user role from the /Users and on refreshing the page, I get the Invalid Permissions error. This also does get triggered if I call a server action from the screen without refreshing the page.

Scenario 2 .
User does not have the role. User gets the invalid permission error on the page. 

I added the role to the user from /Users and on accessing the page again (through the link), I still get the Invalid Permissions error. 
Why do we need to logout and login for a new role being added but not for a role being removed?

Is there a way to force the user to have the new role reflected?


2023-11-20 06-53-17
Neha Rathore

Hi Saiful Aseem Abdul Khader,

The answer that you are searching is best explained in the below link:

https://success.outsystems.com/documentation/11/developing_an_application/secure_the_application/user_roles/

Mainly you can see "Persistency in Roles" session 
Hope this helps

Thanks

Neha Rathore

UserImage.jpg
Saiful Aseem Abdul Khader

Hi Neha,


This only applies for Traditional Apps. Besides, I'm not really granting and revoking during run time using the Grant and Revoke actions. I'm just assigning them from the users module

2023-11-20 06-53-17
Neha Rathore

So this is how it works, for more clarity please refer this discussion link
https://www.outsystems.com/forums/discussion/26742/updating-user-roles-during-a-session/

Hope this helps
If yes please mark this as solution 

Thanks

Neha Rathore

UserImage.jpg
Saiful Aseem Abdul Khader

I did see that post but it's from 2017 which is way before Reactive applications came into picture.It doesn't really help much. Was hoping there might be something new that could help.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.