I am new to SpiceDB and am trying to accomplish a conditional scenario and don't quite know how to write the schema.
I have a boolean that I need to evaluate at the time of permissions check. I would like the permission to be true if the resource has a specific synthetic relationship to the resource AND the boolean is true.
As a simplified example I have a "user" resource that has a either "owner" or "manager" relationship to a "context" resource. Document resources all have a relationship to a single context. Documents can only be edited by a manager of the document context if the boolean variable is true. Otherwise only users with owner relationship of the context can edit a document.
I assume this can be accomplished with a caveat, but I am not sure how to implement this properly.