Skip to content

Add Authority String AuthorizationManager #12231

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

Closed
jzheaux opened this issue Nov 17, 2022 · 1 comment · Fixed by #12328
Closed

Add Authority String AuthorizationManager #12231

jzheaux opened this issue Nov 17, 2022 · 1 comment · Fixed by #12328
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Nov 17, 2022

It would be helpful to have an AuthorizationManager that takes the needed authorities as context.

Something like (pseudocode):

AuthorizationManager<Collection<String>> manager = (authentication, authorities) -> 
        (authentication hasAnyAuthority authorities) ? granted : denied;
@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement labels Nov 17, 2022
@jzheaux jzheaux added this to the 6.1.0-M1 milestone Nov 17, 2022
evgeniycheban added a commit to evgeniycheban/spring-security that referenced this issue Dec 2, 2022
@evgeniycheban
Copy link
Contributor

Hi, @jzheaux I created a PR that adds this new AuthorizationManager and refactors the existing AuthorityAuthorizationManager to use it internally.

jzheaux pushed a commit that referenced this issue Dec 2, 2022
evgeniycheban added a commit to evgeniycheban/spring-security that referenced this issue Jan 4, 2023
- Update copyright header
- Use Set.of instead of HashSet in AuthorityAuthorizationManager
- Align roleHierarchy test name with other tests in AuthoritiesAuthorizationManagerTests
jzheaux pushed a commit that referenced this issue Jan 5, 2023
- Update copyright header
- Use Set.of instead of HashSet in AuthorityAuthorizationManager
- Align roleHierarchy test name with other tests in AuthoritiesAuthorizationManagerTests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants