I'm creating a laravel/php package for roles functionality
Example Roles Required:
blogger
worker
admin
- inherits
*
department.manager
- inherits
department.*
- passive-inherits
department
department
- inherits
worker
department.blogger
- inherits
blogger
- passive-inherits
department
Here's my problem:
Usually many-to-many relationships are set out like this
parent_role_id
| child_role_id
However I'm thinking, since some roles inherit with wildcards (*) eg: admin, department.manager, I can't (or can't fully) use this approach because wildcard's aren't roles...
Would anyone have any ideas?
My solution: parent_role_id
| child_role_id
table + parent_role_id
| wildcard_roles