https://cerbos.dev logo
#help
Title
# help
k

Kiran V

03/09/2023, 11:51 PM
Hi, am trying to use in clause in condition, as shown below
Copy code
resource: products
  rules:
  - actions: ["customExperiences"]
    roles:
      -  USER
    condition:
      match:
        all:
          of:
            - expr: "2021_START" in request.principal.attr.package
am getting error saying "Failed to read: failed to convert YAML to JSON: yaml: line 17: did not find expected key" can you help me on this
d

Dennis (Cerbos)

03/10/2023, 12:01 AM
I believe the YAML parser is confused by a quoted string at the beginning of the
expr
value. Please try this:
'"2021_START" in request.principal.attr.package'
(wrapping value in single quotes)
I’ve just noticed the
rules
field indentation is off.
6 Views