Hello, is there a way to create conditions based o...
# help
c
Hello, is there a way to create conditions based on an attribute being present or not, and use them in Cerbos resource plan? I'd like to have something like
P.attr.business_id ? R.attr.business_id == P.attr.business_id : true
So far the only way I could make it work is by having P.attr.business_id set to an empty string when it's null, but it's not the best
a
I reckon
"business_id" in P.attr ? ...
is probably what you need
c
Thanks, I wasn't aware of this syntax!
🙌🏼 1