Spring Security
  1. Spring Security
  2. SEC-863

hierarchical roles should use the interface GrantedAuthority

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 3.0.0 M1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      spring-security-2.0.1, spring 2.5.4

      Description

      for using a own implementation of GrantedAuthority,

      RoleHierarchyImpl should be changed to use the interface GrantedAuthority with getAuthority() to insert and lookup the keys.

      otherwise all own implementations of GrantedAuthority will not work with hierarchical roles.

      thank you verry much

      mfg Gideon

        Activity

        Hide
        Georgy Bolyuba added a comment -

        This should fix the problem the way I see it. We cannot work with collections directly, so, I wrap calls to reachableRoles.add() and rolesReachableInOneOrMoreSteps.get(). First a search by authority key is done.

        This will work as far as implementation of AccessDecisionVoter does only key (aka authority.getAuthority() ) comparison and does not care about class of GrantedAuthority implementation passed to it.

        Show
        Georgy Bolyuba added a comment - This should fix the problem the way I see it. We cannot work with collections directly, so, I wrap calls to reachableRoles.add() and rolesReachableInOneOrMoreSteps.get(). First a search by authority key is done. This will work as far as implementation of AccessDecisionVoter does only key (aka authority.getAuthority() ) comparison and does not care about class of GrantedAuthority implementation passed to it.
        Hide
        Luke Taylor added a comment -

        Thanks a lot for the patch. I've applied it as it stands with the exception that I used an anonymous class instead of a custom mock GrantedAuthority implementation. Tests pass OK.

        Show
        Luke Taylor added a comment - Thanks a lot for the patch. I've applied it as it stands with the exception that I used an anonymous class instead of a custom mock GrantedAuthority implementation. Tests pass OK.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Matthias Koch
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: