Skip to content

Access policies with arrays in security context #9248

@tagspace

Description

@tagspace

Describe the bug
Can't use array of values for access policy row level filter.

To Reproduce

Given the following access_policy:

cubes:
  - name: customers
    sql_table: public.customers

    access_policy:
      - role: "*"
        row_level:
          filters:
            - member: country
              operator: equals
              values: { securityContext.countries }
...

And the following securityContext:

{
  "countries": [
    "Germany",
    "United States"
  ]
}

If I try to query it:

{
  "dimensions": [
    "customers.country"
  ],
  "measures": [
    "customers.count"
  ],
  "order": {},
  "timeDimensions": []
}

I get error: Unexpected input during yaml transpiling: null

Expected behavior
Should be possible to filter by multiple values (just like the standard filter operator works in cube)

From docs: "row filters are configured using the same format as filters in REST API queries, allowing to use the same set of filter operators, e.g., equals, contains, gte, etc."

Version:
Cube Cloud (1.2.6)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions