PHP Class CakeDC\Users\Auth\Rules\AbstractRule

Inheritance: implements CakeDC\Users\Auth\Rules\Rule, use trait Cake\Core\InstanceConfigTrait, use trait Cake\ORM\Locator\LocatorAwareTrait, use trait Cake\Datasource\ModelAwareTrait
Datei anzeigen Open project: CakeDC/users

Protected Properties

Property Type Description
$_defaultConfig default config

Public Methods

Method Description
__construct ( array $config = [] ) AbstractRule constructor.
allowed ( array $user, string $role, Cake\Network\Request $request ) : boolean Check the current entity is owned by the logged in user

Protected Methods

Method Description
_getTable ( Cake\Network\Request $request, mixed $table = null ) : Table Get a table from the alias, table object or inspecting the request for a default table
_getTableFromRequest ( Cake\Network\Request $request ) : Table Inspect the request and try to retrieve a table based on the current controller

Method Details

__construct() public method

AbstractRule constructor.
public __construct ( array $config = [] )
$config array Rule config

_getTable() protected method

Get a table from the alias, table object or inspecting the request for a default table
protected _getTable ( Cake\Network\Request $request, mixed $table = null ) : Table
$request Cake\Network\Request request
$table mixed table
return Cake\ORM\Table

_getTableFromRequest() protected method

Inspect the request and try to retrieve a table based on the current controller
protected _getTableFromRequest ( Cake\Network\Request $request ) : Table
$request Cake\Network\Request request
return Cake\ORM\Table

allowed() abstract public method

Check the current entity is owned by the logged in user
abstract public allowed ( array $user, string $role, Cake\Network\Request $request ) : boolean
$user array Auth array with the logged in data
$role string role of the user
$request Cake\Network\Request current request, used to get a default table if not provided
return boolean

Property Details

$_defaultConfig protected_oe property

default config
protected $_defaultConfig