Arash
06/30/2023, 5:47 AMjob requires that the user be a manager of EVERY worker on the job.
definition user {}
definition worker {
relation manager: user
permission manage = manager
}
definition job {
relation viewer: user
relation worker: worker
permission edit = viewer & worker->manage // our problem: this only verifies that they can manage at least ONE of the workers, but we would like a way to check that they manage ALL the workers on the job
}
To complicate matters further, we'd also like the user to be able to edit a job if there are NO workers currently on the job. I don't see any obvious or hacky ways to accomplish either of these goals solely in the schema. Ideally, I'd like to avoid implementing this policy in application code. Does anyone have any suggestions on how to achieve this or are we just out of luck? Thanks.ecordell
06/30/2023, 1:26 PMCheck for each in parallel in the meantime.ecordell
06/30/2023, 1:27 PMArash
06/30/2023, 7:02 PM