public abstract class TorqueAbstractPermissionManager extends AbstractPermissionManager
ROLE
Constructor and Description |
---|
TorqueAbstractPermissionManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkExists(String permissionName)
Determines if the
Permission exists in the security
system. |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Avalon Service lifecycle method
|
protected abstract <T extends Permission> |
doSelectAllPermissions(Connection con)
Get all specialized Permissions
|
protected abstract <T extends Permission> |
doSelectById(Integer id,
Connection con)
Get a specialized Permission by id
|
protected abstract <T extends Permission> |
doSelectByName(String name,
Connection con)
Get a specialized Permission by name
|
PermissionSet |
getAllPermissions()
Retrieves all permissions defined in the system.
|
Boolean |
getCustomPeer() |
String |
getPeerClassName() |
<T extends Permission> |
getPermissionById(Object id)
Retrieve a Permission object with specified id.
|
<T extends Permission> |
getPermissionByName(String name)
Retrieve a Permission object with specified name.
|
protected <T extends Permission> |
persistNewPermission(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.
|
void |
setCustomPeer(Boolean customPeer) |
void |
setPeerClassName(String peerClassName) |
addPermission, checkExists, getPermissionInstance, getPermissionInstance
getClassName, setClassName
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class AbstractEntityManager
org.apache.avalon.framework.configuration.ConfigurationException
public Boolean getCustomPeer()
public void setCustomPeer(Boolean customPeer)
public String getPeerClassName()
public void setPeerClassName(String peerClassName)
protected abstract <T extends Permission> List<T> doSelectAllPermissions(Connection con) throws org.apache.torque.TorqueException
con
- a database connectionorg.apache.torque.TorqueException
- if any database error occursprotected abstract <T extends Permission> T doSelectByName(String name, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
name
- the name of the groupcon
- a database connectionorg.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given name existorg.apache.torque.TorqueException
- if any other database error occursprotected abstract <T extends Permission> T doSelectById(Integer id, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
id
- the id of the groupcon
- a database connectionorg.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given id existorg.apache.torque.TorqueException
- if any other database error occurspublic void renamePermission(Permission permission, String name) throws DataBackendException, UnknownEntityException
permission
- The object describing the permission to be renamed.name
- the new name for the permission.DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.public void removePermission(Permission permission) throws DataBackendException, UnknownEntityException
permission
- The object describing the permission to be removed.DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.protected <T extends Permission> T persistNewPermission(T permission) throws DataBackendException
persistNewPermission
in class AbstractPermissionManager
permission
- the object describing the permission to be created.DataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the permission already exists.public PermissionSet getAllPermissions() throws DataBackendException
DataBackendException
- if there was an error accessing the data backend.public boolean checkExists(String permissionName) throws DataBackendException
Permission
exists in the security
system.permissionName
- a Permission
valueDataBackendException
- when more than one Permission with the same name exists.public <T extends Permission> T getPermissionById(Object id) throws DataBackendException, UnknownEntityException
getPermissionById
in interface PermissionManager
getPermissionById
in class AbstractPermissionManager
id
- the id of the Permission.DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.public <T extends Permission> T getPermissionByName(String name) throws DataBackendException, UnknownEntityException
getPermissionByName
in interface PermissionManager
getPermissionByName
in class AbstractPermissionManager
name
- the name of the Group.DataBackendException
- if there was an error accessing the
data backend.UnknownEntityException
- if the group does not exist.Copyright © 2011-2015 The Apache Software Foundation. All Rights Reserved.