Skip to content
Snippets Groups Projects
Commit b940d493 authored by Ron Lucke's avatar Ron Lucke
Browse files

Biest #465

parent 6205adb5
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,11 @@ class Authority ...@@ -38,6 +38,11 @@ class Authority
return $folder->isReadable($user->id); return $folder->isReadable($user->id);
} }
public static function canShowFolderFileRefs(User $user, \FolderType $folder)
{
return self::canShowFolder($user, $folder) || $folder->download_allowed;
}
public static function canUpdateFolder(User $user, \FolderType $folder) public static function canUpdateFolder(User $user, \FolderType $folder)
{ {
return $folder->isEditable($user->id); return $folder->isEditable($user->id);
......
...@@ -24,7 +24,7 @@ class SubfilerefsIndex extends JsonApiController ...@@ -24,7 +24,7 @@ class SubfilerefsIndex extends JsonApiController
throw new RecordNotFoundException(); throw new RecordNotFoundException();
} }
if (!Authority::canShowFolder($this->getUser($request), $folder)) { if (!Authority::canShowFolderFileRefs($this->getUser($request), $folder)) {
throw new AuthorizationFailedException(); throw new AuthorizationFailedException();
} }
......
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