-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontact.yaml
42 lines (39 loc) · 1.01 KB
/
contact.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
apiVersion: api.cerbos.dev/v1
resourcePolicy:
version: default
importDerivedRoles:
- common_roles
resource: contact
rules:
- actions: ["*"]
effect: EFFECT_ALLOW
roles:
- admin
- actions: ["create"]
effect: EFFECT_ALLOW
roles:
- user
condition:
match:
expr: request.principal.attr.department == "Sales"
- actions: ["read", "update", "delete"]
effect: EFFECT_ALLOW
derivedRoles:
- owner
- actions: ["read"]
effect: EFFECT_ALLOW
roles:
- user
condition:
match:
all:
of:
- expr: request.resource.attr.active == true
- any:
of:
- expr: request.principal.attr.department == "Sales"
- all:
of:
- expr: request.principal.attr.department == "Marketing"
- expr: request.resource.attr.marketingOptIn == true