Skip to content

Help needed writing a cel expression for a caveat #1833

Answered by vroldanbet
vmendiratta asked this question in Q&A
Discussion options

You must be logged in to vote

@vmendiratta 👋🏻 we created a custom CEL macro function for this, I think it should do what you expect:

caveat attributes_match(expected map<any>, provided map<any>) {
  expected.isSubtreeOf(provided)
}

See this example in SpiceDB tests

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vmendiratta
Comment options

@vroldanbet
Comment options

@vmendiratta
Comment options

Answer selected by vroldanbet
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