/** * @param string $resource * * @return boolean */ protected function canAccessResource($resource) { $resourceParts = $this->convertResourcePathToArray($resource); $area = $resourceParts[0]; $resource = $resourceParts[1] . '/' . $resourceParts[2] . '/' . $resourceParts[3] . '/'; // At least allow users to access the login page if (isset($this->getResources()[$area][$resource])) { $module = $resourceParts[1]; $privilegeKey = $this->getResources()[$area][$resource]['key']; return $this->userHasPrivilege($module, $privilegeKey) === true || $this->user->isSuperUser() === true; } return false; }
private function setSessionValues() { $this->sessionHandler->set(self::AUTH_NAME, ['id' => $this->userModel->getUserId(), 'super_user' => $this->userModel->isSuperUser(), 'language' => $this->userModel->getLanguage()]); }