protected function checkReadPermissions() { $securityContext = $this->file->getStorage()->getCurrentUserSecurityContext(); if (!$this->file->canRead($securityContext)) { $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_LOCAL_DOC_CONTROLLER_ERROR_BAD_RIGHTS'), self::ERROR_BAD_RIGHTS))); $this->sendJsonErrorResponse(); } }
protected function processBeforeAction($actionName) { parent::processBeforeAction($actionName); $this->findFile(); $securityContext = $this->storage->getCurrentUserSecurityContext(); if (!$this->file->canRead($securityContext)) { $this->showAccessDenied(); return false; } return true; }
protected function checkPermissions() { $securityContext = $this->file->getStorage()->getCurrentUserSecurityContext(); if (!$this->file->canRead($securityContext)) { $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_DOWNLOAD_CONTROLLER_ERROR_BAD_RIGHTS'), self::ERROR_BAD_RIGHTS))); if (Desktop::getDiskVersion()) { $this->sendJsonErrorResponse(); } //general for user we show simple message $this->sendResponse(Loc::getMessage('DISK_DOWNLOAD_CONTROLLER_ERROR_BAD_RIGHTS')); } }