PermissionController Class Reference
Detailed Description
PermissionController checks permissions for a set of operations for the current user.
The controller supports the following actions:
Action checkPermissions
Check permissions of a set of operations for the current user.
| Parameter | Description |
|---|---|
in operations | Array of resource/context/action triples in the form resource?context?action |
out result | Associative array with the operations as keys and boolean values indicating if permissions are given or not |
| Response Actions | |
ok | In all cases |
Action checkPermissionsOfUser
Check permissions of a set of operations for the given user.
| Parameter | Description |
|---|---|
in operations | Array of resource/context/action triples in the form resource?context?action |
in user | Username to check permissions for (optional, default: the authenticated user) |
out result | Associative array with the operations as keys and boolean values indicating if permissions are given or not |
| Response Actions | |
ok | In all cases |
Action getPermissions
Get the permissions on a resource, context, action combination.
| Parameter | Description |
|---|---|
in resource | The resource (e.g. class name of the Controller or ObjectId). |
in context | The context in which the action takes place (optional). |
in action | The action to process. |
out result | Assoziative array with keys 'default' (boolean), 'allow', 'deny' (arrays of role names) or null, if no permissions are defined. |
Action setPermissions
Set the permissions on a resource, context, action combination.
| Parameter | Description |
|---|---|
in resource | The resource (e.g. class name of the Controller or ObjectId). |
in context | The context in which the action takes place (optional). |
in action | The action to process. |
in permissions | Assoziative array with keys 'default' (boolean), 'allow', 'deny' (arrays of role names). |
Action createPermission
Create/Change a permission for a role on a resource, context, action combination.
| Parameter | Description |
|---|---|
in resource | The resource (e.g. class name of the Controller or ObjectId). |
in context | The context in which the action takes place (optional). |
in action | The action to process. |
in role | The role to add. |
in modifier | _+_ or _-_ whether to allow or disallow the action for the role. |
Action removePermission
Remove a role from a permission on a resource, context, action combination.
| Parameter | Description |
|---|---|
in resource | The resource (e.g. class name of the Controller or ObjectId). |
in context | The context in which the action takes place (optional). |
in action | The action to process. |
in role | The role to remove. |
Definition at line 113 of file PermissionController.php.
Inheritance diagram for PermissionController:Public Member Functions | |
| __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, PrincipalFactory $principalFactory) | |
Public Member Functions inherited from Controller | |
| __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration) | |
| initialize (Request $request, Response $response) | |
| execute ($method=null) | |
| getRequest () | |
| getResponse () | |
Protected Member Functions | |
| validate () | |
| doExecute () | |
Protected Member Functions inherited from Controller | |
| validate () | |
| executeSubAction ($action) | |
| getLogger () | |
| getSession () | |
| getPersistenceFacade () | |
| getPermissionManager () | |
| getActionMapper () | |
| getLocalization () | |
| getMessage () | |
| getConfiguration () | |
| assignResponseDefaults () | |
| isLocalizedRequest () | |
| checkLanguageParameter () | |
Constructor & Destructor Documentation
| __construct | ( | Session | $session, |
| PersistenceFacade | $persistenceFacade, | ||
| PermissionManager | $permissionManager, | ||
| ActionMapper | $actionMapper, | ||
| Localization | $localization, | ||
| Message | $message, | ||
| Configuration | $configuration, | ||
| PrincipalFactory | $principalFactory | ||
| ) |
Constructor.
- Parameters
-
$session $persistenceFacade $permissionManager $actionMapper $localization $message $configuration $principalFactory
Definition at line 128 of file PermissionController.php.
Member Function Documentation
|
protected |
- See also
- Controller::validate()
Definition at line 144 of file PermissionController.php.
|
protected |
- See also
- Controller::doExecute()
Definition at line 181 of file PermissionController.php.