/** * */ public function grantvalidateAction() { $res = $this->_getParam('res'); $role = $this->_getParam('role'); $allow = $this->_getParam('allow'); $grant = Zupal_Grants::getInstance()->findOne(array('resource' => $res, 'role' => $role)); if (!$grant) { $grant = new Zupal_Grants(); $grant->resource = $res; $grant->role = $role; } if (strcasecmp('null', $allow)) { $grant->allow = $allow; $grant->save(); } else { $grant->delete(); } $this->_forward('grants'); }