Hi, I have a schema question and I think I'm misunderstanding the documentation. I have a permission scenario about forms that's something of a truth matrix:
1. I need to check that the user is able to view the form's data. I think i have this figured out based on the schema
2. a form is always "about" someone in my use case. I need to also check that the user is permissioned to read data about that person
For example I have form ABC about user Alice. Form ABC uses template 1. Bob has permissions to read template 1, so he can read form ABC. But bob may or may not have permission to read data about Alice. I'm ..not entirely sure how to model the 2nd half.
so my schema looks like this (abbreviated)
definition group {
relation direct_member: user
relation view_groups: group
permission member: direct_member
}
If bob is a member of a group, and the view_group ties to the group alice is in, he should be able to view her data. (I'm not convinced this is the right relationship at all)
definition template {
relation read_data: group
permission read = group->member
}
definition form {
relation about: user
relation form_template: template
permission can_read_data: template->read & ????
}
I've rolled this custom in a postgres database but..we're evaluating authzed to solve a lot of the home-rolled issues.