List Operators
List operators check whether a value exists in a set or whether a collection contains a value.
Check if a value is one of a set of allowed values:
__role__ of **User** is in ["admin", "moderator", "editor"]Interactive Example
Policy Rule
Test Data (JSON)
Works with numbers too:
Interactive Example
Policy Rule
Test Data (JSON)
Is Not In
Section titled “Is Not In”Check if a value is not in a set (blocklist):
__status__ of **User** is not in ["banned", "suspended", "deleted"]Interactive Example
Policy Rule
Test Data (JSON)
Contains
Section titled “Contains”Check if a string or collection contains a value:
__tags__ of **Article** contains "featured"Interactive Example
Policy Rule
Test Data (JSON)
Contains All Of
Section titled “Contains All Of”Check if a list contains every element from another list:
__permissions__ of **User** contains all of ["read", "write"]Interactive Example
Policy Rule
Test Data (JSON)
Returns false if even one element is missing:
Interactive Example
Policy Rule
Test Data (JSON)
Contains Any Of
Section titled “Contains Any Of”Check if a list contains at least one element from another list:
__roles__ of **User** contains any of ["admin", "superadmin"]Interactive Example
Policy Rule
Test Data (JSON)
Summary
Section titled “Summary”| Operator | Use case |
|---|---|
is in [...] | Value is one of a set (allowlist) |
is not in [...] | Value is none of a set (blocklist) |
contains | String/collection contains a value |
contains all of [...] | List contains every element from another list |
contains any of [...] | List contains at least one element from another list |