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

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

Usage Example

Example #1
0
 /**
  * Deny access for an ARO to an ACO.
  *
  * @return void
  */
 public function deny()
 {
     extract($this->_getParams());
     if ($this->Acl->deny($aro, $aco, $action)) {
         $this->out(__d('cake_acl', 'Permission denied.'));
     } else {
         $this->out(__d('cake_acl', 'Permission was not denied.'));
     }
 }