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

SEC-2196: @PreAuthorize doesn't work with method wich using generics #2423

Closed
spring-issuemaster opened this issue Jul 9, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link

commented Jul 9, 2013

Nick Denizhenko (Migrated from SEC-2196) said:

Using @PreAuthorize annotations on methods which using generics doesn't seem to work.

My code is like this:

@PreAuthorize("hasAuthority('saveUsers')")
public T save(T dto) {
....
}

Security interceptor doesn't work in this case, but annotated proxy methods works properly:

@PreAuthorize("hasAuthority('saveUsers')")
public User proxySave(User dto) {
save(dto);
}

my settings is:
<security:global-method-security secured-annotations="enabled" pre-post-annotations="enabled"/>

Seems like security interceptor doesn't affect methods with generics.

Also a similar problem is described here:
http://forum.springsource.org/showthread.php?139620-Spring-Security-ACL-PreAuthorize-Generics-with-an-Interface-possible-bug&p=450408

@spring-issuemaster

This comment has been minimized.

Copy link
Author

commented Sep 13, 2013

Rob Winch said:

The issues you link to seem like they may be related to using interfaces and trying to access the arguments within SpEL. There is an issue is logged already as SEC-2151

I am unable to produce the issue that you describe. Please provide a complete test case that fails otherwise this issue will be closed as cannot reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.