Spring Security
  1. Spring Security
  2. SEC-1022

Remove use of static methods/initializers in Acl Permissions

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0 RC1
    • Component/s: ACLs
    • Labels:
      None

      Description

      This has caused some problems and reduces the pluggability of Permission generation strategies, so we've agreed it should be modified in 2.5. PermissionFactory should probably also be modified to contain more of the methods that are currently static, allowing implementations to be called when evaluating expressions, for example (see PermissionEvaluator, AclPermissionEvaluator).

        Issue Links

          Activity

          Hide
          Thomas Champagne added a comment -

          You can use the spring util namespace :
          <util:constant static-field="org.springframework.security.acls.domain.BasePermission.ADMINISTRATION"/>

          Show
          Thomas Champagne added a comment - You can use the spring util namespace : <util:constant static-field="org.springframework.security.acls.domain.BasePermission.ADMINISTRATION"/>
          Hide
          Luke Taylor added a comment -

          I've removed the use of static initialization from the permission classes. Instead of invoking static methods on BasePermission in order to convert masks/names to Permissions, classes should use a PermissionFactory. DefaultPermissionFactory is used by default and can have custom Permissions injected. By default it introspects BasePermission and registers its static fields by name.

          Show
          Luke Taylor added a comment - I've removed the use of static initialization from the permission classes. Instead of invoking static methods on BasePermission in order to convert masks/names to Permissions, classes should use a PermissionFactory. DefaultPermissionFactory is used by default and can have custom Permissions injected. By default it introspects BasePermission and registers its static fields by name.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: