/** * @param int $id * * @return array|\Symfony\Component\HttpFoundation\RedirectResponse * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($id) { $role = $this->rolesModel->getOneById($id); if (!empty($role)) { $this->title->setPageTitlePostfix($role['name']); if ($this->request->getPost()->count() !== 0) { return $this->executePost($this->request->getPost()->all(), $id); } return ['parent' => $id != 1 ? $this->fetchRoles($role['parent_id'], $role['left_id'], $role['right_id']) : [], 'modules' => $this->fetchModulePermissions($id), 'form' => array_merge($role, $this->request->getPost()->all()), 'form_token' => $this->formTokenHelper->renderFormToken()]; } throw new Core\Controller\Exception\ResultNotExistsException(); }