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

AuthorizationDenied and Granted EventListeners Should Support Generics #16700

Open
jzheaux opened this issue Mar 6, 2025 · 1 comment
Open
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
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

No branches or pull requests

2 participants