seala va
06/21/2022, 4:02 PMCharith (Cerbos)
seala va
06/22/2022, 1:30 AMseala va
06/22/2022, 10:40 AMCharith (Cerbos)
orgs: ["org_a", "org_b"]
channels: ["chan_x", "chan_y", "chan_z"]
and, in your request, you include the organization, channel and author of the resource:
{
"resource": {
"id": "XX125",
"kind": "article",
"attr": {
"organization": "org_a",
"channel": "chan_x",
"author": "user_p"
}
}
}
You can define a derived role for channel_editor
as follows:
- name: channel_editor
parentRoles: ["chan_editor"]
condition:
match:
all:
of:
- expr: request.resource.attr.organization in request.aux_data.jwt.orgs
- expr: request.resource.attr.channel in request.aux_data.jwt.channels
Then you can define a policy rule for article edit
as follows:
- actions: ['edit']
effect: EFFECT_ALLOW
derivedRoles:
- channel_editor
condition:
match:
expr: request.resource.attr.author == request.principal.id
Charith (Cerbos)
seala va
06/22/2022, 1:02 PMCharith (Cerbos)