Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggetions: Using spatie laravel-permission instead of a custom build #15

Open
twf-nikhila opened this issue Feb 12, 2019 · 4 comments
Open

Comments

@twf-nikhila
Copy link

Firstly, thanks for this awesome starter kit.

I think it will be really nice if instead of having a custom developed permission/group management spatie:laravel-permission package is used. https://github.com/spatie/laravel-permission

Advantages

  • Better support for permission management
  • Easy to use as compared to the one used here.
  • Detailed documentation
  • Flexibility (like configurable table names for permission, roles etc)
  • Support for the cache which makes permission validation faster instead of querying for each permission.

Many developers are already familiar with this package, so adding I think adding it will certainly make this better.

Looking forward to hearing all of your opinions.

@darryldecode
Copy link
Owner

Thank you for your input. I know spatie library since it was still young but it was lacking some complex permission handling before versus the laravel sentry which this custom build was inspired from. But I can see the spatie has grown already and for sure it has already those complex permission that was missing before.

When I say complex permission handling, here is an example:

We give permission to be able to "add" and "delete" for GROUP A.
Then we assign user 1 to GROUP A. So User 1 will have those permissions.
Then now we have user 2 added to GROUP A as well, but we don't want user 2
to be able to "delete", so we assign a special permission to user 2 to deny him for delete permission.

This scenario was not supported in spatie way back year ago when it was young. but laravel sentry has this but sentry was not free. So I created my own custom built with the sentry capabilities.

To be honest, I don't have plans implementing a 3rd party permission handling since the goal for this is to be stand alone much as possible. And transitioning to using spatie will be a bit of work and I have a very hectic schedule at the moment. But I will consider looking into spatie again when I have the time.

Happy coding!

@twf-nikhila
Copy link
Author

Thank you for the detailed response. Definitely transition to spatie Laravel permission will take time & effort, but will be worth it. I can send a PR if you want this to be included. Let me know.

Thank you

@darryldecode
Copy link
Owner

Hi @twf-nikhila , if you can do that w/o affecting much on how UX is presented with managing user, groups & permissions, that would be great! We will have two branches then, 1 for the spatie version. Thanks!

@sparkEEdev
Copy link

am actually interested in this, would love to help out with migration if anyone has started working on it

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

No branches or pull requests

3 participants