Skip to content

Does SpiceDB support relation hierarchies (e.g. operations on relations)? #1494

Answered by jakedt
seeruk asked this question in Q&A
Discussion options

You must be logged in to vote

This is something that Zanzibar supports out of the box, and that we actually supported in our v0 APIs. It is something that we explicitly chose to move away from when we created the schema.

You can accomplish what you want by just referencing a computed permission from another permission:

definition user {}

/** resource is an example resource. */
definition resource {
	relation viewer: user
	relation writer: user

	permission view = viewer + write
	permission write = writer
}

By having a strict separation between permissions (computed) and relations (direct relationships) we get:

  • flexibility to mutate permissions freely while being able to reason about the computation complexity
  • a con…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jzelinskie
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/question Clarifying a question without code changes area/schema Affects the Schema Language
2 participants
Converted from issue

This discussion was converted from issue #189 on August 17, 2023 16:18.