Skip to content

How can I check resource permission with resource attribute ? #2372

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

You must be logged in to vote

We don't typically recommend using caveat for this because it is not a dynamic aspect of the resource - caveats were designed to be used for anything that can only be defined at request time (think anything that comes along your application's API request).

You can easily model this using wildcards:

definition user {}

definition resource {
  relation public: user:*
  relation viewer: user
  relation writer: user

  permission view = viewer +  writer + public
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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