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?
Not a bad idea. Let me check this.
Okay, I changed the code to delegation and all tests passed. So this is not an issue anymore. You can close it. Thanks
Ok. Thanks for the update.