Are there any condition method "toString"? #1694
-
Hi all. I am using conditions to create the - name: owner
parentRoles: ["auditor", "admin", "superadmin"]
condition:
match:
all:
of:
- expr: request.resource.attr.createdBy == request.principal.attr._id
- expr: request.principal.attr.locked == false But Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Conditions are written using the Common Expression Language (CEL). You can cast a value to a string using the But, when a policy is evaluated, these fields no longer have the type MongoDB ObjectId. The payload is serialised when the application calls the Cerbos endpoint. The serialisation might be incorrect. For debugging or auditing purposes, you can enable request and response payload logging for each request. See Payload logging. |
Beta Was this translation helpful? Give feedback.
Conditions are written using the Common Expression Language (CEL). You can cast a value to a string using the
string(x)
function.But, when a policy is evaluated, these fields no longer have the type MongoDB ObjectId. The payload is serialised when the application calls the Cerbos endpoint. The serialisation might be incorrect.
For debugging or auditing purposes, you can enable request and response payload logging for each request. See Payload logging.