I need to design a schema where the
- users has permissions (read, write, edit,...)
- users are assigned to organisation
- cases are assigned to organisation
- users can access cases whose organisation matches that of the user.
- users have permissions like read, write, edit.... on cases that are in the same organisation.
what I've modelled so far is:
relation read : user
relation write : user
realtion edit : user
relation user : user
relation permissionmatrix: permissionmatrix
permission read = user & permissionmatrix -> read
permission write = user & permissionmatrix -> write
relation organisation : organisation
permission read = organisation -> read
permission write = organisation -> write
idea is to be able to do permission check like:
Is the above schema the best way to model the relationship?