Yousef Sultan

03/02/2023, 7:23 AM
So I've use CASL.js before and they have this thing where you can query if X can do Y to any Z. Does Cerbos have such a thing?
Basically instead of calling Cerbos and saying hey, can "Yusuf" really "read" Article "How to cook noodles" I want to just: can "Yusuf" "read" any "Article"?
The reason I ask is that it allows rejecting the request much much earlier than hitting the DB to fetch the data only to make a decision on that

Andrew Haines (Cerbos)

03/02/2023, 9:17 AM
Hi Yousef, yep, I think you could use the plan resources API to achieve this. If the principal cannot perform the action on any resource, then the query plan you get back will have

Yousef Sultan

03/02/2023, 9:20 AM
Got it, thanks!