Forums de discussion

Injects in the user session the Liferay groups after login

William L, modifié il y a 9 années.

Injects in the user session the Liferay groups after login

New Member Publications: 3 Date d'inscription: 25/06/14 Publications récentes
Hello,

I wanted to ask if it's possible to inject in the user session the Liferay groups after login.

I want to do this because I want to retrieve the user groups from the server (in order to not to manage users-groups assignment in two places: server and Liferay) and set the groups in the session.

This way, the groups would exist in Liferay in order to establish the access to the pages based in this groups, but with no users assigned. When a user logs in, I would retrieve the groups from the server and set them in the session (if possible), so this user could access to the pages of these groups.

Thanks in advance.
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Injects in the user session the Liferay groups after login

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
When I've dealt with this type of thing before, I've used a LoginPostAction implementation. At that point, you derive the groups the user should be a member of (whether a DB query, LDAP query, or whatever) and can modify the Liferay User record, updating those memberships.

This is the least-impacting path because it ensures the memberships will be available for the entirety of the Liferay core. This is actually the major consideration you need to be aware of - any change you want to make must be in line with standard Liferay processing or you risk breaking the portal functionality.