user
: Represents a user in the system.
workspace
: Represents a workspace in which users can collaborate. Each workspace has an owner, members, guests, and bots associated with it. The owner and admin users have permission to manage the workspace. Permissions are defined for creating pages, inviting members, viewing the workspace, and managing the workspace. The read and write permissions can be inherited by child entities.
page
: Represents a page within a workspace. Each page is associated with a workspace and has a writer and readers. The read and write permissions are defined based on the writer and readers of the page and can be inherited from the workspace.
database
: Represents a database within a workspace. Each database is associated with a workspace and has an editor and viewers. The read and write permissions are defined based on the editor and viewers of the database and can be inherited from the workspace. Permissions are also defined for creating and deleting databases.
block
: Represents a block within a page or database. Each block is associated with a page or database and has an editor and commenters. The read and write permissions are defined based on the editor and commenters of the block and can be inherited from the database. Commenters are users who have permission to comment on the block.
comment
: Represents a comment on a block. Each comment is associated with a block and has an author. The read and write permissions are defined based on the author of the comment and can be inherited from the block.
template
: Represents a template within a workspace. Each template is associated with a workspace and has a creator and viewers. The read and write permissions are defined based on the creator and viewers of the template and can be inherited from the workspace. Permissions are also defined for creating and deleting templates.
integration
: Represents an integration within a workspace. Each integration is associated with a workspace and has an owner. Permissions are defined for reading and writing to the integration.
reader
relation specifies the users who are members of the workspace associated with the page (workspace#member
) or guests of the workspace (workspace#guest
).
Read permission of the workspace inherited as workspace.read
in the page entity. THis permission specifies that any user who has been granted read access to the workspace object (i.e., the workspace that the page belongs to) can also read the page.
In summary, any user who is a member or guest of the workspace and has been granted read access to the page through the reader relation, as well as any user who has been granted read access to the workspace itself, can read the contents of the page.
Can user:alice write database:task_list ?
database:task_list
)database:task_list#workspace@workspace:engineering_team
)database:task_list
)Based on the relation tuples we created, user:alice
doesn’t have the editor relationship with the database:task_list
.Since user:alice
is the owner and admin in the engineering team workspace (workspace:engineering_team#admin@user:alice
) it has a write permission defined in the workspace entity, as you can see below:database:task_list#workspace@workspace:engineering_team
). Therefore, the user:alice write database:task_list
check request should yield a ‘true’ response.Can user:charlie write page:product_spec ?
user:charlie
is guest in the workspace (workspace:engineering_team#guest@user:charlie
) and the engineering team workspace is the only workspace that page:product_spec
belongs to.As we defined, guests doesn’t have write permission in a workspace.user:charlie
doesn’t have a write relationship in the workspace. And ultimately, the user:charlie write page:product_spec
check request should yield a ‘false’ response.make serve
.
permify validate {path of your schema validation file}
to start the test process.
The validation result according to our example schema validation file: