Dynamic Role changes

  
Hi. 
I have an app where I manage the user's access to some of the pages using the Outsystems Roles. However, I want to be able to give them permissions through my app on runtime, and I've come across something that I would like to clarify. 
User_Roles permissions are stored in session, right? So, if I change a user's access to some pages (giving him a new role, for example), and if the user is already logged, he won't be able to access the pages anyway, correct?
Have I understood this right?
Is there any way around this that allows us to force the permissions to be recalculated, or something?

Thanks in advance,
Maria
Coloca as permissões especiais em variáveis de sessão e setando elas a medida que for necessário.
gyndaniel wrote:
Coloca as permissões especiais em variáveis de sessão e setando elas a medida que for necessário.
 Sorry, what do you mean?
 
Hi Maria,

To dynamically add a role to a user, you need to call the role's Grant action, that you can find on the Logic tab in Service Studio:


Note that if the role has its "Is Persistent" property set, granting a role is persistent, i.e. is remembered when the user logs out. If you have fully dynamic roles, set "Is Persistant" to No, and after user login (or whenever it's pertinent) call the GrantXxxxRole action of the Role you need to grant.