/** * 权限列表 */ public function assignAction() { $this->view->roles = $this->role->getAll(); $this->view->roleId = (int) $this->_request->getParam('role_id'); if ($this->view->roleId == 0) { $this->view->roleId = $this->view->roles[0]['role_id']; //获取第一个角色 } elseif (!$this->role->idExists($this->view->roleId)) { $this->view->feedback(array('title' => '发生错误', 'message' => '指定的角色 ID 不存在或者已经被删除')); } $this->view->layout = array('title' => '管理后台 - 添加规则'); $this->view->ruleGroup = $this->rule->getRuleGroup(); $this->view->allowRules = $this->acl->getRoleAllowRule($this->view->roleId); }