Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Set user Role depending Ldap group membership #138

Closed
ikerib opened this issue Mar 24, 2017 · 2 comments
Closed

Set user Role depending Ldap group membership #138

ikerib opened this issue Mar 24, 2017 · 2 comments

Comments

@ikerib
Copy link

ikerib commented Mar 24, 2017

Hi,
I have this bundle installed and configured with FOSUserBundle and it works really good. Thanks!!

Whats I need now is to assign different ROLES depending witch ldap ther user is member.
for instance, if the user in LDAP is member of the group "Administrators" it has to have ROLE_ADMIN, or if is member of LDAP group "AppAdmin" it has to have "ROLE_MANAGER" otherwise "ROLE_USER".

How can I achieve that? Any clue?
Thanks in advance

@ikerib ikerib changed the title Set user Role depend from Ldap group membership Set user Role depending Ldap group membership Mar 24, 2017
@CoalaJoe
Copy link
Contributor

Use this:
image

- { ldap_attr: memberof, user_method: addLdapGroup }

Then, use an eventlistener on the user-entity to check if he has been created, and map the ldapGroups to roles.

@ikerib
Copy link
Author

ikerib commented Mar 30, 2017

yes, I've done it with it, thanks anyway! I forgot to close this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants