PHP Class Acl\Controller\Component\AclComponent

Inheritance: extends Cake\Controller\Component
Datei anzeigen Open project: cakephp/acl Class Usage Examples

Public Properties

Property Type Description
$Aco string Aco object
$Aro string Aro object.

Protected Properties

Property Type Description
$_Instance Acl\AclInterface Instance of an ACL class

Public Methods

Method Description
__construct ( Cake\Controller\ComponentRegistry $collection, array $config = [] ) Constructor. Will return an instance of the correct ACL class as defined in Configure::read('Acl.classname')
adapter ( Acl\AclInterface | string $adapter = null ) : Acl\AclInterface | void Sets or gets the Adapter object currently in the AclComponent.
allow ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean Pass-thru function for ACL allow instance. Allow methods are used to grant an ARO access to an ACO.
check ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean Pass-thru function for ACL check instance. Check methods are used to check whether or not an ARO can access an ACO
deny ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean Pass-thru function for ACL deny instance. Deny methods are used to remove permission from an ARO to access an ACO.
inherit ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean Pass-thru function for ACL inherit instance. Inherit methods modify the permission for an ARO to be that of its parent object.

Method Details

__construct() public method

Constructor. Will return an instance of the correct ACL class as defined in Configure::read('Acl.classname')
public __construct ( Cake\Controller\ComponentRegistry $collection, array $config = [] )
$collection Cake\Controller\ComponentRegistry A ComponentRegistry
$config array Array of configuration settings

adapter() public method

$this->Acl->adapter(); will get the current adapter class while $this->Acl->adapter($obj); will set the adapter class Will call the initialize method on the adapter if setting a new one.
public adapter ( Acl\AclInterface | string $adapter = null ) : Acl\AclInterface | void
$adapter Acl\AclInterface | string Instance of AclInterface or a string name of the class to use. (optional)
return Acl\AclInterface | void either null, or the adapter implementation.

allow() public method

Pass-thru function for ACL allow instance. Allow methods are used to grant an ARO access to an ACO.
public allow ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean
$aro array | string | Model ARO The requesting object identifier. See `AclNode::node()` for possible formats
$aco array | string | Model ACO The controlled object identifier. See `AclNode::node()` for possible formats
$action string Action (defaults to *)
return boolean Success

check() public method

Pass-thru function for ACL check instance. Check methods are used to check whether or not an ARO can access an ACO
public check ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean
$aro array | string | Model ARO The requesting object identifier. See `AclNode::node()` for possible formats
$aco array | string | Model ACO The controlled object identifier. See `AclNode::node()` for possible formats
$action string Action (defaults to *)
return boolean Success

deny() public method

Pass-thru function for ACL deny instance. Deny methods are used to remove permission from an ARO to access an ACO.
public deny ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean
$aro array | string | Model ARO The requesting object identifier. See `AclNode::node()` for possible formats
$aco array | string | Model ACO The controlled object identifier. See `AclNode::node()` for possible formats
$action string Action (defaults to *)
return boolean Success

inherit() public method

Pass-thru function for ACL inherit instance. Inherit methods modify the permission for an ARO to be that of its parent object.
public inherit ( array | string | Model $aro, array | string | Model $aco, string $action = "*" ) : boolean
$aro array | string | Model ARO The requesting object identifier. See `AclNode::node()` for possible formats
$aco array | string | Model ACO The controlled object identifier. See `AclNode::node()` for possible formats
$action string Action (defaults to *)
return boolean Success

Property Details

$Aco public_oe property

Aco object
public string $Aco
return string

$Aro public_oe property

Aro object.
public string $Aro
return string

$_Instance protected_oe property

Instance of an ACL class
protected AclInterface,Acl $_Instance
return Acl\AclInterface