Reputation: 654
I have a scenario where I need to have 3 user roles for a system. The permissions for each role are clear but under one of the roles, I need to create several subroles and each subrole should be having definite function level permission grants. Also at times, a grant irrespective of the roles should be given to an individual user for any of the CRUD actions. How can I achieve this design in database with minimalistic complications. I am doing this project in laravel. Some guidelines in the framework for this would be very helpful. Thank you.
Upvotes: 1
Views: 3134
Reputation: 57
You can do that by creating a roles table, permission table, and roles_has_permission table and can work with different roles and even with different permission to different roles There is a beautiful package in Github spatie-laravel-permission
You can use it That does not answer you desired though I wanted to comment the post but I'm no privileged to do so yet thanks.
Upvotes: 3
Reputation: 9465
There are a couple of ways to do this:
Upvotes: 2