/**
* Checks the file access.
*
* @param $path
*
* @throws AccessDeniedException
*/
public function checkAccess($path)
{
$file = null;
try {
$file = $this->webFilesystem->getFile($path);
} catch (FileNotFoundException $e) {
while ('/' !== $path) {
try {
$path = dirname($path);
$file = $this->webFilesystem->getFile($path);
} catch (FileNotFoundException $e) {
}
}
}
if ($file && !$this->acl->isUpdatable('jarves/file', array('path' => $path))) {
throw new AccessDeniedException(sprintf('No access to file `%s`', $path));
}
}