Skip to content

Is it possible to return caveats or metadata with a check #1806

Answered by vroldanbet
ashley-taylor asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand correctly, you must return all orders a user can access with resource_id that starts with a.
You can do LookupResources, iterate over the cursor, and drop any resource_id that does not start with a.

A bit unorthodox but you could add a caveat to the relation that grants the permission, you need to place it strategically in a relation that will result in caveating the Order for the user. This is probably one of those instances where the caveat in the permission could be useful. If you have multiple ways an order is owned, it may get trickier because you have to caveat all the relations through which the user can get access to an Order, depending on your model it may be feas…

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