Class HibernatePermissionManagerImpl
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.hibernate.HibernatePermissionManagerImpl
- 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 HibernatePermissionManagerImpl extends AbstractPermissionManager
This implementation persists to a database via Hibernate.
- Version:
- $Id: HibernatePermissionManagerImpl.java 1374014 2012-08-16 19:47:27Z tv $
- Author:
- Eric Pugh
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HibernatePermissionManagerImpl() -
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.PermissiongetPermissionById(Object id)Retrieve a Permission object with specified id.PersistenceHelpergetPersistenceHelper()protected PermissionpersistNewPermission(Permission 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, 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
-
HibernatePermissionManagerImpl
public HibernatePermissionManagerImpl()
-
-
Method Details
-
getAllPermissions
Retrieves all permissions defined in the system.- Returns:
- the names of all roles 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- aPermissionvalue- Returns:
- true if the permission name 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.
-
getPersistenceHelper
- Returns:
- Returns the persistenceHelper.
-
getPermissionById
Retrieve a Permission object with specified id.- Specified by:
getPermissionByIdin interfacePermissionManager- Overrides:
getPermissionByIdin classAbstractPermissionManager- Parameters:
id- the id of the Permission.- Returns:
- an object representing the Permission with specified id.
- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the permission does not exist.
-