Class MemoryPermissionManagerImpl
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.security.spi.AbstractManager
org.apache.fulcrum.security.spi.AbstractEntityManager
org.apache.fulcrum.security.spi.AbstractPermissionManager
org.apache.fulcrum.security.memory.MemoryPermissionManagerImpl
- All Implemented Interfaces:
Serializable
,org.apache.avalon.framework.activity.Disposable
,org.apache.avalon.framework.configuration.Configurable
,org.apache.avalon.framework.logger.LogEnabled
,org.apache.avalon.framework.service.Serviceable
,org.apache.avalon.framework.thread.ThreadSafe
,PermissionManager
This implementation keeps all objects in memory. This is mostly meant to help
with testing and prototyping of ideas.
- Version:
- $Id: MemoryPermissionManagerImpl.java 1374008 2012-08-16 19:42:18Z tv $
- Author:
- Eric Pugh
- See Also:
-
Field Summary
Fields inherited from class org.apache.fulcrum.security.spi.AbstractManager
manager
Fields inherited from interface org.apache.fulcrum.security.PermissionManager
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkExists
(String permissionName) Determines if thePermission
exists in the security system.Retrieves all permissions defined in the system.protected <T extends Permission>
TpersistNewPermission
(T permission) Creates a new permission with specified attributes.void
removePermission
(Permission permission) Removes a Permission from the system.void
renamePermission
(Permission permission, String name) Renames an existing Permission.Methods inherited from class org.apache.fulcrum.security.spi.AbstractPermissionManager
addPermission, checkExists, getPermissionById, getPermissionByName, getPermissionInstance, getPermissionInstance
Methods inherited from class org.apache.fulcrum.security.spi.AbstractEntityManager
configure, getClassName, setClassName
Methods inherited from class org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
MemoryPermissionManagerImpl
public MemoryPermissionManagerImpl()
-
-
Method Details
-
getAllPermissions
Retrieves all permissions defined in the system.- Returns:
- the names of all permissions defined in the system.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
renamePermission
public void renamePermission(Permission permission, String name) throws DataBackendException, UnknownEntityException Renames an existing Permission.- Parameters:
permission
- The object describing the permission to be renamed.name
- the new name for the permission.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.
-
checkExists
Determines if thePermission
exists in the security system.- Parameters:
permissionName
- aString
value- Returns:
true
if the permission exists in the system, false otherwise- Throws:
DataBackendException
- when more than one Permission with the same name exists.
-
removePermission
public void removePermission(Permission permission) throws DataBackendException, UnknownEntityException Removes a Permission from the system.- Parameters:
permission
- The object describing the permission to be removed.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.
-
persistNewPermission
Creates a new permission with specified attributes.- Specified by:
persistNewPermission
in classAbstractPermissionManager
- Parameters:
permission
- the object describing the permission to be created.- Returns:
- a new Permission object that has id set up properly.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-