Fórum

Temporary role

Sebastian Herbst, modificado 13 Anos atrás.

Temporary role

New Member Postagens: 9 Data de Entrada: 09/02/11 Postagens Recentes
Hello,

I'm looking for something to set a role to the guest-user temporary for one session for one user so that another user doesn't gets the same permissions.
I know how to set a role, but this isn't temporary.

The backgrund is that the user can decide which kind of "role" he wants to be without to log in. Closing the connection restes the made decisions. Other users shouldn't be affected.
On this decision the portal decides which content is shown.

I'm not sure if the concept with roles is teh right way to do something like this, but it would be realy easy.

Hope someone knows how to do this
Mario Arrigoni Neri, modificado 12 Anos atrás.

RE: Temporary role

New Member Postagens: 8 Data de Entrada: 16/03/09 Postagens Recentes
I have the same problem.
I need to customize some pages according to the fact that user logs in from internet or extranet. So I need to mark the user as an "Extranet user" just for current session.
Is there any way to describe such situation?
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: Temporary role

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
It's possible to dynamically create roles but it would be difficult to delete this role
once the user logs out because a user may just close the browser instead of
hitting the "Sign Out" link.
Mario Arrigoni Neri, modificado 12 Anos atrás.

RE: Temporary role

New Member Postagens: 8 Data de Entrada: 16/03/09 Postagens Recentes
Thank you for the reply.
I'm afraid the problem is more complicated, because I cannot simply add a new role to the user profile, but I have to bind such a role to the session.
If two sessions are open (at the same time) by the same user one from the extranet and one from internet the role "extranet_user" must be active only for one of them.
If this is not the case an user could login from his home and keep this section alive until it opens a new one from the office taking the rights of an "extranet user" from his home.

So the role cannot be associated to the user itself, but onlyt to the active session.
I find it quite similar to the role "User" or "authenticated_user" that can be activated only when I log in explicitly by uid/password (and not by cookie or similar).
Maybe we could look at some SSO feature, I suppose liferay to call some intermediate level service to retrieve active roles before going to the profilation DB. If such a service could access portal session we could approcah the problem via a plugin.

thanks again

Mario