Hello,
I'm currently adding roles and permissions in an application.
Here is a short description of this application.
-
clients have trainings, employees, reports, contacts, ...
-
trainings have employees, documents and belong to some properties like category, state, place, ...
-
there are also complex pages (search, complex exports, ...) with datas from clients, trainings, ... on the same page
-
there are also some actions like exporting datas to Excel depending on several models
I'm using Spatie roles and permissions to manage the permissions. I have chosen to assign permissions only to roles (no direct permissions to users).
For the basic permissions on CRUD actions for categories, states, places, ...), it's quite easy to define the permissions, for example : view any, view one, create, update, delete.
But it's not easy for complex pages.
For example a page display a training : training identity, employees, financial informations, ...
How is it possible to organize the permissions with some hierarchical rules ?
For example :
-
a role allowed to view the trainings should automatically be allowed to view the clients
-
but it could be possible that the role isn't allowed to view the employees list for the clients, but allowed to see the training with the registered employees
Do you have any suggestions to organize the permissions ?
Thanks for your help.
V