Package org.apache.fulcrum.security
Interface PermissionManager
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractPermissionManager
public interface PermissionManager extends Serializable
A PermissionManager performsPermission
objects related tasks on behalf of theBaseSecurityService
. The responsibilities of this class include loading data of an permission from the storage and putting them into thePermission
objects, saving those data to the permanent storage.- Version:
- $Id$
- Author:
- Eric Pugh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Permission>
TaddPermission(T permission)
Creates a new permission with specified attributes.boolean
checkExists(String permissionName)
Determines if aPermission
exists in the security system with the specified name.boolean
checkExists(Permission permission)
Determines if thePermission
exists in the security system.PermissionSet
getAllPermissions()
Retrieves all permissions defined in the system.<T extends Permission>
TgetPermissionById(Object id)
Retrieve a Permission object with specified Id.<T extends Permission>
TgetPermissionByName(String name)
Retrieve a Permission object with specified name.<T extends Permission>
TgetPermissionInstance()
Construct a blank Permission object.<T extends Permission>
TgetPermissionInstance(String permName)
Construct a blank Permission object.void
removePermission(Permission permission)
Removes a Permission from the system.void
renamePermission(Permission permission, String name)
Renames an existing Permission.
-
-
-
Method Detail
-
getPermissionInstance
<T extends Permission> T getPermissionInstance() throws DataBackendException
Construct a blank Permission object. This method calls getPermissionClass, and then creates a new object using the default constructor.- Type Parameters:
T
- permission type- Returns:
- an object implementing Permission interface.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
getPermissionInstance
<T extends Permission> T getPermissionInstance(String permName) throws DataBackendException
Construct a blank Permission object. This method calls getPermissionClass, and then creates a new object using the default constructor.- Type Parameters:
T
- permission type- Parameters:
permName
- The name of the Permission- Returns:
- an object implementing Permission interface.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
getPermissionByName
<T extends Permission> T getPermissionByName(String name) throws DataBackendException, UnknownEntityException
Retrieve a Permission object with specified name.- Type Parameters:
T
- permission type- Parameters:
name
- the name of the Permission.- Returns:
- an object representing the Permission with specified name.
- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the permission does not exist.
-
getPermissionById
<T extends Permission> T getPermissionById(Object id) throws DataBackendException, UnknownEntityException
Retrieve a Permission object with specified Id.- Type Parameters:
T
- permission type- Parameters:
id
- the Id of the Permission.- Returns:
- an object representing the Permission with specified name.
- Throws:
UnknownEntityException
- if the permission does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getAllPermissions
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.
-
addPermission
<T extends Permission> T addPermission(T permission) throws DataBackendException, EntityExistsException
Creates a new permission with specified attributes.- Parameters:
permission
- The object describing the permission to be created.- Returns:
- the new Permission object.
- Throws:
DataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the permission already exists.
-
removePermission
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.
-
renamePermission
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
boolean checkExists(Permission permission) throws DataBackendException
Determines if thePermission
exists in the security system.- Parameters:
permission
- aPermission
value- Returns:
- true if the permission exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one Permission with the same name exists.
-
checkExists
boolean checkExists(String permissionName) throws DataBackendException
Determines if aPermission
exists in the security system with the specified name.- Parameters:
permissionName
- the name of aPermission
to check- Returns:
- true if the permission exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one Permission with the same name exists.
-
-