cerbos, seems pretty cool - wondering if I can com...
# help
d
cerbos, seems pretty cool - wondering if I can combine derivedRoles w/ a logical AND op when I write resourcePolicy
or does that implicitly involve role inheritance (and is hence not supported)
@Dennis (Cerbos)
for example say I have derivedRole based on locale then a derivedRole based on function (ex: manager)
i want to write a resourcePolicy that allows Florida based managers to perform some action
I know I can create “Florida_manager” derivedRole
d
Thanks. I got your use case. That’s not supported now, but we are considering adding it.
d
but that can quickly multiply?
ok thank you for clarifying
can you recommend a best practice for this at the moment
d
This is the approach of creating “Florida_manager” roles unfortunately, but as a temporary workaround, you can use Yaml manipulation tools to avoid copy-pasting.
d
ok got it thanks!
what are some yaml manipulation would you recommend for this - im familiar w yq
maybe @Charith (Cerbos) cc @Dennis (Cerbos)
c
ytt is my personal favourite.
Cue is another choice.
d
@Alex Olivier (Cerbos) or @Aldin Kiselica - in defining a derivedRole - looks like parentRoles have to original id issuer role (or whatever I choose to stick into the request in the roles [] list) it cannot be another derived role - can you confirm?
cc @Emre (Cerbos)
d
Correct, you can’t use another derived role as a parent role. You can only reference roles that you pass in the request, with the exception of using wildcards.
d
ok makes sense - back to the whole ‘no role hierarchy’ as a intentional design choice, makes sense
can i set a default parentRole
since I’m mostly using attributes to determine derivedRoles
d
No, there’s NO notion of a default parent role, but you can use `*`meaning any role.
d
ok playing w/ ytt - can someone point me to a cerbos specific example - maybe @Alex Olivier (Cerbos) cc @Dennis (Cerbos)
d
I don’t think we have a public example with ytt.
d
got it, I have something I can push if there is repo where that makes sense
d
@Aldin Kiselica
c
Please push to your own repo and share the link on #community