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
public class MemoryPermissionManagerImpl extends AbstractPermissionManager
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:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MemoryPermissionManagerImpl() -
Method Summary
Modifier and Type Method Description booleancheckExists(String permissionName)Determines if thePermissionexists in the security system.PermissionSetgetAllPermissions()Retrieves all permissions defined in the system.protected <T extends Permission>
TpersistNewPermission(T permission)Creates a new permission with specified attributes.voidremovePermission(Permission permission)Removes a Permission from the system.voidrenamePermission(Permission permission, String name)Renames an existing Permission.Methods inherited from class org.apache.fulcrum.security.spi.AbstractPermissionManager
addPermission, checkExists, getPermissionById, getPermissionByName, getPermissionInstance, getPermissionInstanceMethods inherited from class org.apache.fulcrum.security.spi.AbstractEntityManager
configure, getClassName, setClassNameMethods inherited from class org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
-
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, UnknownEntityExceptionRenames 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 thePermissionexists in the security system.- Parameters:
permissionName- aStringvalue- Returns:
trueif 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, UnknownEntityExceptionRemoves 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:
persistNewPermissionin 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.
-