Problem description
It would be nice to add some more membership operators.
For example, I have auth_roles on a viewer, which is a list of roles (viewer has_many auth_roles). I want to check that :start_discussions role is a member of the viewers auth roles.
permit()
|> permission_to(:start_discussion, Article, viewer: [auth_roles: {:contains, [:start_discussions]}])
Proposed solution
Add an operator like contains to check inside of a list
Alternatives considered
No response
Use case
To use when you are checking an association that is a list for membership
Desired API/code example
permit()
|> permission_to(:start_discussion, Article, viewer: [auth_roles: {:contains, [:start_discussions]}])
Priority (1-5)
1 - Low - Nice to have
Additional Context
No response
Checklist
Problem description
It would be nice to add some more membership operators.
For example, I have auth_roles on a viewer, which is a list of roles (viewer has_many auth_roles). I want to check that :start_discussions role is a member of the viewers auth roles.
permit()
|> permission_to(:start_discussion, Article, viewer: [auth_roles: {:contains, [:start_discussions]}])
Proposed solution
Add an operator like contains to check inside of a list
Alternatives considered
No response
Use case
To use when you are checking an association that is a list for membership
Desired API/code example
Priority (1-5)
1 - Low - Nice to have
Additional Context
No response
Checklist