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'));
     }
 }