Class DefaultPermissionFactory
java.lang.Object
org.springframework.security.acls.domain.DefaultPermissionFactory
- All Implemented Interfaces:
PermissionFactory
Default implementation of
PermissionFactory
.
Used as a strategy by classes which wish to map integer masks and permission names to Permission instances for use with the ACL implementation.
Maintains a registry of permission names and masks to Permission instances.
- Since:
- 2.0.3
-
Constructor Summary
ConstructorDescriptionRegisters the Permission fields from the BasePermission class.DefaultPermissionFactory
(Class<? extends Permission> permissionClass) Registers the Permission fields from the supplied class.DefaultPermissionFactory
(Map<String, ? extends Permission> namedPermissions) Registers a map of named Permission instances. -
Method Summary
Modifier and TypeMethodDescriptionbuildFromMask
(int mask) Dynamically creates aCumulativePermission
orBasePermission
representing the active bits in the passed mask.buildFromName
(String name) buildFromNames
(List<String> names) protected void
registerPermission
(Permission perm, String permissionName) protected void
registerPublicPermissions
(Class<? extends Permission> clazz) Registers the public static fields of typePermission
for a give class.
-
Constructor Details
-
DefaultPermissionFactory
public DefaultPermissionFactory()Registers the Permission fields from the BasePermission class. -
DefaultPermissionFactory
Registers the Permission fields from the supplied class. -
DefaultPermissionFactory
Registers a map of named Permission instances.- Parameters:
namedPermissions
- the map of Permissions, keyed by name.
-
-
Method Details
-
registerPublicPermissions
Registers the public static fields of typePermission
for a give class.These permissions will be registered under the name of the field. See
BasePermission
for an example.- Parameters:
clazz
- aPermission
class with public static fields to register
-
registerPermission
-
buildFromMask
Description copied from interface:PermissionFactory
Dynamically creates aCumulativePermission
orBasePermission
representing the active bits in the passed mask.- Specified by:
buildFromMask
in interfacePermissionFactory
- Parameters:
mask
- to build- Returns:
- a Permission representing the requested object
-
buildFromName
- Specified by:
buildFromName
in interfacePermissionFactory
-
buildFromNames
- Specified by:
buildFromNames
in interfacePermissionFactory
-