Acl\Controller\Component\AclComponent::inherit PHP Method

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
    public function inherit($aro, $aco, $action = "*")
    {
        return $this->_Instance->inherit($aro, $aco, $action);
    }

Usage Example

Beispiel #1
0
 /**
  * Set an ARO to inherit permission to an ACO.
  *
  * @return void
  */
 public function inherit()
 {
     extract($this->_getParams());
     if ($this->Acl->inherit($aro, $aco, $action)) {
         $this->out(__d('cake_acl', 'Permission inherited.'));
     } else {
         $this->out(__d('cake_acl', 'Permission was not inherited.'));
     }
 }