Spatie Permission #566
RobertoLanzeni
started this conversation in
General
Replies: 4 comments
-
I would love to get some insights in how to do this |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @RobertoLanzeni, By "role" are you referring to "group"? LDAP directories do not contain a representation for roles. If so, you can utilize the https://ldaprecord.com/docs/laravel/v3/auth/restricting-login#checking-for-a-single-group use LdapRecord\Models\ActiveDirectory\User;
$user = User::findOrFail('cn=John Doe,ou=dc=local,dc=com');
$isAdmin = $user->groups()->exists('cn=Administrators,ou=Groups,dc=local,dc=com'); |
Beta Was this translation helpful? Give feedback.
0 replies
-
See also #571 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Which I have now updated with an answer, @RobertoLanzeni . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys.
I've extended my app with LdapRecord Package.
First myApp did login with database in local directly from App. Now I've switched to remote login on LDAP server.
I've noticed that i can't retrieve role of single users, because spatie use local DB to get role of each User.
How can I use this package to get which Role() Users have?
Thanks for your reply
Bo
Beta Was this translation helpful? Give feedback.
All reactions