Hi,
Does this package have support for group permissions or teams? where i can assign permissions to a group like the one in laratrust (https://github.com/santigarcor/laratrust) package?
Hi,
This package doesn't currently support "teams" the way Laratrust does.
As to your question regarding groups I'm not sure what you mean. We do support roles which are essentially groups of permissions that can be assigned to users (just like Laratrust).
i used groups to refer to same thing as teams.
@nikklass It does support groups. I've done it that way.
I've built it so that a user is part of a group, and a group has many users, with a User and a Group model.
On the Group model, I've put the HasRoles trait.
From there, it works exactly as it normally would.
Ok. I was looking for a situation where i can assign roles/ permissions to an individual user? Or if needed also assign roles/permissions to a group, like u just said. Do i have to implement the group association myself? And if so, do i have to assign the HasRoles trait to both group and user models?
You can do it where you can assign to both.
The way I have it is thetrait is on the group, and there is a relationship between the user and the group. Then I assign a role to the group, and a user belongs to a group.
Then, when doing my checks i jsut get the group that the user belongs to and check it that way.
I have yet to find a way to check what roles a user has without using the group relationship.
Ok. Thats fine. my initial question was based on teams. I wanted a scenario where i have teams. Each team has users in them. A user can belong to many teams. The user will have different permissions based on which team(s) they belong to. When logged in, the user can browse each team they belong to, and perform CRUD actions as allowed in the allocated permissions. How wud i tackle that with spatie?
i think laratrust is the package to solve all these. Thanks.
Most helpful comment
i think laratrust is the package to solve all these. Thanks.