Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SEC-1556: remove final from DelegatingMethodSecurityMetadataSource #1797

spring-issuemaster opened this Issue Sep 4, 2010 · 5 comments


None yet
1 participant

Wolfgang Winter (Migrated from SEC-1556) said:


For the next release of Cibet control framework (www.logitags.com/cibet) I have integrated Spring Security authorization. It was possible but I had to do some 'dirty' hacks which could be avoided if Spring Security provides some very small changes:

DelegatingMethodSecurityMetadataSource seems to be the default MetadataSource in MethodSecurityInterceptor. I cannot use the cache in DelegatingMethodSecurityMetadataSource because my ConfigAttributes depend not only from class and method but also from other context parameters. I have to implement another cache but want to inherit and reuse code in DelegatingMethodSecurityMetadataSource.

Problem: Cannot inherit because DelegatingMethodSecurityMetadataSource is final.
Workaround: I duplicate the code into my CibetDelegatingMethodSecurityMetadataSource.
Solution: remove final from class DelegatingMethodSecurityMetadataSource

Wolfgang Winter said:

One more point concerning this:
In AbstractMethodSecurityMetadataSource the Collection getAttributes(Object object) method is also final but I want to overwrite it because I have a third object type as parameter.
Workaround: duplicate the code
Solution: remove final from getAttributes(Object object) method

Luke Taylor said:

Can't you use delegation instead of inheritance here?

Wolfgang Winter said:

Not a bad idea. Let me check this.

Wolfgang Winter said:

Okay, I changed the code to delegation and all tests passed. So this is not an issue anymore. You can close it. Thanks

Luke Taylor said:

Ok. Thanks for the update.

@spring-issuemaster spring-issuemaster added this to the 3.1.0.M2 milestone Feb 5, 2016

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