List of some major tasks to do.
currently you can do as following:
guard.assignRoles(user, ['superadmin','admin'])
guard.assignRoles(user, 'superadmin')
desired : pass multiple roles
guard.assignRoles([user, user2], ['superadmin', 'admin']);
guard.assignRoles([
{
user: user,
role: 'superadmin',
},
{
user: user2,
role: 'admin',
},
]);
Write API to create child roles. Database and models are already setup to have this.
Just create easy api to support that.
-
Polymorphic relationship with role dso than, Any model can have roles.
-
If possible (not sure) make permission polymorphic too.
e.g. If we give role "commentable" to Post, and "Commentable" role has permission to "have comments" then we can check.
BlogPost.can('have comments').