Hi
I'm planning a multi customer website to manage teams. Customer can create users, teams, events and so on. As I'm new in developing with Laravel, I'm wondering if I'm on the right path with my permission concept. I thought, that I will implement different roles like administrator, editor and reader. Data for events, members, teams and so on are stored in different tables. Is it ok, if I store the permission in one separate table 'permission' which will have following fields...
- id
- id_user
- role (like administrator, editor, reader)
- type (keyword for table like 'events', 'teams' or 'members')
- content_id (id of item id in table according type)
With different policies I would check if the user is authorized to do any actions. For example if the user would like to add new members to a team, I would perform a query to the table permissions. If there would be an entry with the user_id, the role 'editor', the type 'teams' and the id of the team, he would be able to perform the action.
Is this solution ok or is there a more easy or better way?