--- apiVersion: api.cerbos.dev/v1 resourcePolicy: version: "default" importDerivedRoles: - apatr_common_roles resource: "album:object" rules: - actions: ['*'] effect: EFFECT_ALLOW derivedRoles: - owner - actions: ['view', 'flag'] effect: EFFECT_ALLOW roles: - user condition: match: expr: request.resource.attr.public == true - actions: ['view', 'delete'] effect: EFFECT_ALLOW derivedRoles: - abuse_moderator - actions: ['view-as-vip'] effect: EFFECT_ALLOW roles: - user condition: match: expr: request.principal.attr.vip == true