/**
  * @param FileEvent $event
  */
 public function doPermissionsCheck(FileEvent $event)
 {
     if ($this->adapter->isFileReadableByAnonymous($event->getFile())) {
         return;
     }
     $this->publisher->unpublishAllVersions($event->getFile());
 }
 public function checkFolderWrite(FolderEvent $event)
 {
     $folder = $event->getFolder();
     if (!$this->adapter->isFolderWritable($folder)) {
         $this->dispatchDenyEvent($folder);
         throw $this->createAccessDeniedException($folder, 'write');
     }
 }