Skip to content
Snippets Groups Projects
Commit 6f037035 authored by Marcus Eibrink-Lunzenauer's avatar Marcus Eibrink-Lunzenauer
Browse files

Allow users to see files that are downloadable to them.

If a user knows the ID of a file and that file is downloadable to them, they may see the metadata of that file too.

Fixes #285.
parent 0f79e648
No related branches found
No related tags found
No related merge requests found
......@@ -55,12 +55,7 @@ class Authority
public static function canShowFileRef(User $user, \FileRef $fileRef)
{
$folder = $fileRef->foldertype;
return
$folder
&& $folder->isVisible($user->id)
&& $folder->isReadable($user->id);
return $fileRef->getFileType()->isVisible($user->id) || $fileRef->getFileType()->isDownloadable($user->id);
}
public static function canUpdateFileRef(User $user, \FileRef $fileRef)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment