rjv's avatar
Level 7

An elegant way to implement a granular permission system

I'd be interested to see a take on some type of granular permissions system that could managed through an admin interface. For instance, a user could be assigned to a particular role and that role can perform X and Y, but not Z. Preferably you could add capabilities (e.g. X, Y and Z) into a database, give roles access to them, and then incorporate the access conditions into the application's code.

I'm sure there are packages out there that do this already, but seeing one get built step-by-step would be interesting and informative.

0 likes
1 reply
martink8's avatar

I built a package which probably doesn't work with Laravel 5.1 anymore. It is really really simple but achieves almost everything you asked for (no gui). There are only 2 models and a User model trait.

https://github.com/mkoterle/Roleable

Please or to participate in this conversation.