Jonathan Janisch
07/26/2024, 4:45 AMhierarchy(request.principal.attr.tenantId)
.overlaps(hierarchy(request.resource.scope))
Invalid expression `hierarchy(request.principal.attr.tenantId).overlaps(hierarchy(request.resource.scope))`: [undefined field 'scope'] (invalid expression)The hierarchy CEL examples in the docs show scope in the attributes object, but then you have to duplicate the scope:
"principal": {
"id": "john",
"roles": ["employee"],
"attr": {
"tenantId": "tenant1"
}
},
"resource": {
"kind": "leave_request",
"scope": "tenant1.foo.bar",
"attr": {
"scope": "tenant1.foo.bar"
}
}
Charith (Cerbos)
Charith (Cerbos)