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
-
Fields inherited from class org.apache.fulcrum.security.spi.AbstractManager
manager
-
Fields inherited from interface org.apache.fulcrum.security.PermissionManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description MemoryPermissionManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkExists(String permissionName)
Determines if thePermission
exists in the security system.PermissionSet
getAllPermissions()
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
-
-
-
-
Constructor Detail
-
MemoryPermissionManagerImpl
public MemoryPermissionManagerImpl()
-
-
Method Detail
-
getAllPermissions
public PermissionSet getAllPermissions() throws DataBackendException
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
public boolean checkExists(String permissionName) throws DataBackendException
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
protected <T extends Permission> T persistNewPermission(T permission) throws DataBackendException
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.
-
-