Fratt
12/17/2025, 8:50 PMyetitwo
12/17/2025, 10:24 PM# in slightly different ways.
it's talking about this:
definition resource {
relation viewer: user | group#view
// ^ if "view" on "group" is a permission, that's a no-no
}Fratt
12/17/2025, 11:18 PMdefinition organization {
/** administrator indicates that the user is an admin of the org */
relation administrator: user
/** view_all_documents indicates whether a user can view all documents in the org */
permission view_all_documents = administrator
}
/** document represents a document with access control */
definition document {
/** docorg indicates that the organization owns this document */
relation docorg: organization
/** reader indicates that the user is a reader on the document */
relation reader: user
/** writer indicates that the user is a writer on the document */
relation writer: user
/** view indicates whether the user can view the document */
permission view = reader + writer + docorg->view_all_documents
}
Assertions:
> assertTrue:
> - "document:specificdocument#view@user:someadminuser"
https://authzed.com/docs/spicedb/modeling/developing-a-schema#assertionsyetitwo
12/17/2025, 11:19 PMFratt
12/17/2025, 11:21 PMyetitwo
12/17/2025, 11:29 PMyetitwo
12/17/2025, 11:30 PMrelations part of the assertions, the part after the # has to be a concrete relationyetitwo
12/17/2025, 11:31 PMassert blocks, they're just a way of notating a check between a subject an an object, and the bit in the middle can be a concrete relation or be a permission that represents a whole set of transitive permissions/relationsFratt
12/17/2025, 11:46 PMyetitwo
12/17/2025, 11:50 PM