Skip to content

Could objects, not subjects, have caveats? Or is there a way to add conditionals to permissions? #1933

Closed Answered by josephschorr
nik-kumar-td asked this question in Q&A
Discussion options

You must be logged in to vote

The current way is to have a reference to the resource itself, and caveat that:

definition resource {
  relation platform_reserved: resource

  permission view_internal = viewer + owner + ...
  permission view = platform_reserved->view_internal
}

You'd only write the platform_reserved (pointing to the same resource) if that condition existed. You can similarly caveat that "self relationship" to assign a caveat on the object itself

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nik-kumar-td
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
None yet
2 participants