/** * 权限列表 */ public function action_assign() { $this->template->roles = $roles = $this->role->getAll(); $this->template->roleId = $roleId = (int) $this->getQuery('role_id'); if ($roleId == 0) { $this->template->roleId = $roles[0]['role_id']; //获取第一个角色 } elseif (!$this->role->idExists($roleId)) { $this->show_message('发生错误:指定的角色 ID 不存在或者已经被删除'); } $this->template->layout['title'] = $this->acl->modDesc . ' - 权限指派'; $this->template->ruleGroup = $this->rule->getRuleGroup(); $this->template->allowRules = $allowRules = $this->acl->getRoleAllowRule($roleId); }