Combining Global and Team Specific Roles
In my app I have teams that can create roles for users, each role having a specific set of permissions. However, I want to have a couple global roles that apply to all teams and have fixed permissions (e.g. Administrator role). Here is my proposed table
permissions - id, slug, name team_roles - id, team_id (null if global), name team_role_permissions - id, team_role_id, permission_id team_role_users - id, team_role_id, user_id
Is it best to combine these global roles in the team_roles table with a global flag (null team_id)? What's the best way to combine global and local permissions? My worry here was that the global role permissions are just as dynamic as the team ones but I don't intend for the global ones to ever change. I did check this laracasts episode: https://laracasts.com/lessons/users-and-roles but it didn't cover permissions at any level.
Thanks in advance
Please or to participate in this conversation.