we currently have a very simple security schema...
we have resources, that roughly maps to tables, we have access to that resources (add, modify, delete, query) and we have groups.
each permission consists of a resource, with a specified access and a group
and each user can belong to many groups...
so, permission is a many-to-many between group, access and resource
and we also have a many-to-many between user and group.
this is just fine for our needs...
what I'm trying to think is a method to grant permission to data, at the record level, with a similar scheme. I need a way to "filter" records according to the user access level.
for example, the users belonging to a certain group can see all records of a table (resource), but users from another group can only see records which satifies a specific condition, that they see the data filtered...
I was thinking about adding a "expression" field to the permission table, so that when accessing a certain resource the filter is applied (in fact it would be a little more complicated, I would have to apply each filter of the groups to which the user belongs, joined with an "or")
I'd like it to be as general and configurable as possible...
How would you handle such a use case?