Spring Security
  1. Spring Security
  2. SEC-1556

remove final from DelegatingMethodSecurityMetadataSource

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.1.0.M2
    • Component/s: Core
    • Labels:
      None

      Description

      Hi,

      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

        Activity

        Hide
        Wolfgang Winter added a comment -

        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

        Show
        Wolfgang Winter added a comment - 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
        Hide
        Luke Taylor added a comment -

        Can't you use delegation instead of inheritance here?

        Show
        Luke Taylor added a comment - Can't you use delegation instead of inheritance here?
        Hide
        Wolfgang Winter added a comment -

        Not a bad idea. Let me check this.

        Show
        Wolfgang Winter added a comment - Not a bad idea. Let me check this.
        Hide
        Wolfgang Winter added a comment -

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

        Show
        Wolfgang Winter added a comment - Okay, I changed the code to delegation and all tests passed. So this is not an issue anymore. You can close it. Thanks
        Hide
        Luke Taylor added a comment -

        Ok. Thanks for the update.

        Show
        Luke Taylor added a comment - Ok. Thanks for the update.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Wolfgang Winter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: