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

Add an 'OR' option to @Access #382

Open
jskupsik opened this issue Aug 13, 2024 · 1 comment
Open

Add an 'OR' option to @Access #382

jskupsik opened this issue Aug 13, 2024 · 1 comment

Comments

@jskupsik
Copy link
Contributor

We have a convenient@Access annotation, powered by AccessInterceptor.groovy, which supports a list of role names and requires a user to have all of those roles in order to get access to the tagged class or endpoint method.

We are missing a way of easily annotating an OR permission, where a user would be required to have at least one of the roles listed to access an endpoint.

@amcclain amcclain changed the title Add an 'OR' option to @Access Add an 'OR' option to @Access Sep 5, 2024
@amcclain
Copy link
Member

amcclain commented Sep 5, 2024

I would argue this would be the more useful / expected default behavior, given that the annotation takes a collection. I more commonly think of "adding roles to an ACL" where each role is granted access, vs. "specifying a list of roles where you must have all of them".

Not saying we should go and change the default, but we could consider it. I highly doubt there are many (any?) examples out there with multiple roles. We could provide a new way to spec the "AND" case and then release with a big changelog banner to call out the need for a quick code search.

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

No branches or pull requests

2 participants