Core/OperationControlList.php
- Package
- Default
\OperationControlList
Package: Default



Provides controll over executable operations per described entities
Supports wildcards as global level.
For instance, following array will set any operation available for any entity:
array( "*" => array( "*" => true ));
Next example will restrict an operation for all entities, except Foo
array(
"*" => array( "operation" => false ),
"Foo" => array( "operation" => true ),
);
- Author
- amatiushkin
Constants
Properties
Methods

__construct(\type $array = array()) : voidIt is possible to specify rules upon instance creation In common it used to add first global rule, e.g.
Next line of code will enable all for all:
new OperationControlList( OperationControlList::getDefaultList(true) )
Parameters| Name | Type | Description |
|---|---|---|
| $array | \type |

appendRules(\type $array = array()) : voidAppends rules to existing list
Parameters
| Name | Type | Description |
|---|---|---|
| $array | \type |

getDefaultList(boolean $value) : arraystatic
Returns global configuration array (in other words global rule)
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $value | boolean |
| Type | Description |
|---|---|
| array |

isAllowed(string $entity, string $operation) : booleanVerifies if operation is available for some entity
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $entity | string | |
| $operation | string |
| Type | Description |
|---|---|
| boolean |