Andrew Bettke
05/13/2025, 4:55 PMAndrew Bettke
05/13/2025, 4:59 PMsuperadmin
role policy that defines that anyone who is a super admin should have global access to the system (ie, any resource + action combo is allowed if you have this role).
This is how I've modeled the super admin role policy
{
"apiVersion": "api.cerbos.dev/v1",
"rolePolicy": {
"role": "superadmin",
"rules": [
{
"resource": "*",
"allowActions": [
"*"
]
}
]
}
}
Then when trying to make a check request (see below) and passing in the role as superadmin
the result always comes back as EFFECT_DENY
. What would be the proper way to model this kind of situation?
{
"principal": {
"id": "7700ebbc-05a2-4f64-acd7-e20f25aff527",
"scope": "fcdc562c-546c-4cca-8fee-e557a642dc9d",
},
"roles": [
"superadmin"
]
},
"resources": [
{
"actions": [
"get"
],
"resource": {
"kind": "myresource",
"id": "resourceId"
}
}
],
"includeMeta": true
}
Sam Lock (Cerbos)
05/14/2025, 2:29 PM---
apiVersion: api.cerbos.dev/v1
resourcePolicy:
version: "default"
resource: salary_record
rules:
- actions:
- create
- delete
effect: EFFECT_ALLOW
roles: ["admin"]
Then you'd need to add parentRoles
to the role policy like this:
---
apiVersion: "api.cerbos.dev/v1"
rolePolicy:
role: superadmin
parentRoles:
- admin
rules:
- resource: "*"
allowActions:
- "*"
Andrew Bettke
05/14/2025, 2:51 PMAndrew Bettke
05/14/2025, 2:52 PM