document if both of these conditions are met:
- they are a member of the organization that owns the document
- they have writer permissions on the document
Before You Start
In order to understand this guide correctly you must be familiar with some Auth0 FGA Concepts and know how to develop the things that we will list below.Step By Step
With the above authorization model and relationship tuples, Auth0 Fine-Grained Authorization (FGA) will correctly respond with{"allowed":true} when *check*is called to see if Carl and Becky can write this document.
We can verify that by issuing two check requests:
What we would like to do is offer a way so that a document can be written by Becky and Carl, but only writers who are also members of the organization that owns the document can remove it.
To do this, we need to:
- Add can_delete relation to only allow writers that are members of the ownership organization
- Verify that our solutions work
01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization
The first step is to add the relation definition forcan_delete so that it requires users to be both writer and member of the owner. This is accomplished via the keyword and.