Ejemplo n.º 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_console', 'Permission denied.'), true);
     } else {
         $this->out(__d('cake_console', 'Permission was not denied.'), true);
     }
 }
Ejemplo n.º 2
0
 function clearAcl($groupAlias, $data)
 {
     App::import('Component', 'Acl');
     $acl = new AclComponent();
     foreach ($data as $val) {
         $acl->deny($groupAlias, $val);
     }
     return;
 }
Ejemplo n.º 3
0
 /**
  * Deny access for an ARO to an ACO.
  *
  * @access public
  */
 function deny()
 {
     $this->_checkArgs(3, 'deny');
     extract($this->__getParams());
     if ($this->Acl->deny($aro, $aco, $action)) {
         $this->out(__("Permission denied.", true), true);
     } else {
         $this->out(__("Permission was not denied.", true), true);
     }
 }
 /**
  * Sync the ARO table
  *
  * @return void
  **/
 public function permissions_reset($params = array())
 {
     // @codingStandardsIgnoreEnd
     $this->Aro->query('TRUNCATE aros_acos;');
     $configFile = APP . 'Config' . DS . 'Permissions' . DS . 'permissions.ini';
     $ini_array = parse_ini_file($configFile, true);
     foreach ($ini_array as $group => $permissions) {
         $denyList = isset($permissions['deny']) ? $permissions['deny'] : array();
         $allowList = isset($permissions['allow']) ? $permissions['allow'] : array();
         $groupId = $this->_getGroupId($group);
         $this->Group = ClassRegistry::init('Group');
         $group = $this->Group;
         $group->id = $groupId;
         foreach ($denyList as $action) {
             $this->Acl->deny($group, $action);
         }
         foreach ($allowList as $action) {
             $this->Acl->allow($group, $action);
         }
         unset($this->Group);
     }
     $this->out(__('<success>Permissions Reset Complete</success>'));
     return true;
 }
Ejemplo n.º 5
0
 /**
  * Pass-thru function for ACL deny instance. Deny methods
  * are used to remove permission from an ARO to access an ACO.
  *
  * @param string $aro ARO The requesting object identifier.
  * @param string $aco ACO The controlled object identifier.
  * @param string $action Action (defaults to *)
  * @return boolean Success
  * @access public
  */
 function deny($aro, $aco, $action = "*")
 {
     $this->flushCache();
     return parent::deny($aro, $aco, $action);
 }
 /**
  * Deny method.
  *
  * This method overrides and uses the original
  * method. It only adds cache to it.
  *
  * @param string $aro ARO
  * @param string $aco ACO
  * @param string $action Action (defaults to *)
  * @access public
  */
 function deny($aro, $aco, $action = "*")
 {
     parent::deny($aro, $aco, $action);
     $this->__deleteCache($aro, $aco, $action);
 }