Core/OperationControlList.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
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

>VConstant  ALL = '*'

Properties

>VPropertyprivate$operationList = array()
Default valuearray()Details
Type
n/a

Methods

methodpublic__construct(\type $array = array()) : void

It 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
NameTypeDescription
$array\type
methodpublicappendRules(\type $array = array()) : void

Appends rules to existing list

Parameters
NameTypeDescription
$array\type
methodpublicgetDefaultList(boolean $value) : array
static

Returns global configuration array (in other words global rule)

Parameters
NameTypeDescription
$valueboolean
Returns
TypeDescription
array
methodpublicgetOperationList() : \type

Returns current operations control list

Returns
TypeDescription
\type
methodpublicisAllowed(string $entity, string $operation) : boolean

Verifies if operation is available for some entity

Parameters
NameTypeDescription
$entitystring
$operationstring
Returns
TypeDescription
boolean
methodpublicsetOperationList(array $array) : void

Defines operations control list, any previosly existing rules will be removed

Parameters
NameTypeDescription
$arrayarray
Documentation was generated by phpDocumentor 2.8.5.