예제 #1
0
파일: ACL.php 프로젝트: acp3/core
 /**
  * @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;
 }
예제 #2
0
 private function setSessionValues()
 {
     $this->sessionHandler->set(self::AUTH_NAME, ['id' => $this->userModel->getUserId(), 'super_user' => $this->userModel->isSuperUser(), 'language' => $this->userModel->getLanguage()]);
 }