Skip to content

AuthorizationDenied and Granted EventListeners Should Support Generics #16700

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 Mar 6, 2025 · 1 comment · Fixed by #16762
Closed

AuthorizationDenied and Granted EventListeners Should Support Generics #16700

jzheaux opened this issue Mar 6, 2025 · 1 comment · Fixed by #16762
Assignees
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Mar 6, 2025

It would be nice if users could listen for authorization events specific to the type of source:

@EventListener
public void onEvent(AuthorizationDeniedEvent<MethodInvocation> event) {
    // ...
}

One way this can be done is by having AuthorizationDeniedEvent and AuthorizationGrantedEvent implement ResolvableTypeProvider:

ResolvableType type = ResolvableType.forClassWithGenerics(getClass(), ResolvableType.forInstance(getObject()));
@jzheaux jzheaux added in: core An issue in spring-security-core status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement labels Mar 6, 2025
@jzheaux jzheaux self-assigned this Mar 6, 2025
@franticticktick
Copy link
Contributor

Hi @jzheaux, i would like to work on this ticket, could you assign it to me please?

@jzheaux jzheaux removed the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Mar 7, 2025
franticticktick added a commit to franticticktick/spring-security that referenced this issue Mar 18, 2025
franticticktick added a commit to franticticktick/spring-security that referenced this issue Mar 18, 2025
franticticktick added a commit to franticticktick/spring-security that referenced this issue Mar 20, 2025
franticticktick added a commit to franticticktick/spring-security that referenced this issue Mar 20, 2025
jzheaux added a commit to franticticktick/spring-security that referenced this issue Mar 20, 2025
- These ensure that the parameterized version of authorization events
can be listened to

Issue spring-projectsgh-16700
jzheaux added a commit that referenced this issue Mar 20, 2025
- These ensure that the parameterized version of authorization events
can be listened to

Issue gh-16700
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