Hi everybody,
I’m trying to access the user group of a user who logs into the cms. I tried to write my own custom Authentication Provider and just log the user group but until now I had no success.
I only managed to write a custom login class which extends the DefaultLoginPlugin and now I’m able to log the username in the loginSuccess method of every user that logs in.
Is there a not to complicated way to also get the user group of that user?
Thanks in regards!
To retrieve the groups of a user, use the user’s session to perform a simple jcr query for hipposys:group nodes. Because of security, and unless this user is an admin, your results will contain only the groups this user can see, which are the ones he belongs in.