Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if user is present in any of multiple possible group names #271

Open
wants to merge 6 commits into
base: default
Choose a base branch
from

Conversation

RoxasShadow
Copy link

@RoxasShadow RoxasShadow commented Oct 4, 2021

Hello nice folk 😄

This PR is an attempt at implementing the feature request in #149, which happens to be also something that my team at @simplybusiness needs as well.

In order to not introducing any breaking changes, I have made possible to add additional elements to any array member of required_groups so that we can introduce exclusive operations in without touching any of the inclusive logic operation that are done among all the members of required_groups.

I hope this make sense to you. I haven't seen any tests covering the #in_required_groups? part of #authorized? - I will try to add something here as soon as I am able to run the whole tests suite in my local machine.

Thank you.

Target cschiewek#149.

Should not be a breaking change since both the code and the documentation
clearly state that `required_groups` members either are strings,
or must have only two elements when any member is an array.

The feature here is that we can list a number of groups after the attribute
and at least any of them has to be matched to be able to pass the verification.
@Greg-Myers-SB
Copy link

@RoxasShadow do you mean #149 ?

@RoxasShadow
Copy link
Author

@RoxasShadow do you mean #149 ?

Yes, that was a typo, thanks!

Copy link

@JaydaKad JaydaKad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work 👍

@RoxasShadow
Copy link
Author

> rspec spec/unit/connection_spec.rb
..............

Finished in 0.04252 seconds (files took 1.86 seconds to load)
14 examples, 0 failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants