mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 11:00:39 +00:00
- gate implementation
- protected shared view fix
This commit is contained in:
@@ -21,19 +21,19 @@ class VerifyAccessToItemAction
|
||||
->get();
|
||||
|
||||
// Get all authorized parent folders by shared folder as root of tree
|
||||
$accessible_folder_ids = Arr::flatten([filter_folders_ids($foldersIds), $shared->item_id]);
|
||||
$accessible_parent_ids = Arr::flatten([filter_folders_ids($foldersIds), $shared->item_id]);
|
||||
|
||||
// Check user access
|
||||
if (is_array($requested_id)) {
|
||||
foreach ($requested_id as $id) {
|
||||
if (! in_array($id, $accessible_folder_ids)) {
|
||||
if (! in_array($id, $accessible_parent_ids)) {
|
||||
abort(403);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! is_array($requested_id)) {
|
||||
if (! in_array($requested_id, $accessible_folder_ids)) {
|
||||
if (! in_array($requested_id, $accessible_parent_ids)) {
|
||||
abort(403);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class VerifyAccessToItemWithinAction
|
||||
): void {
|
||||
// Check by parent folder permission
|
||||
if ($shared->type === 'folder') {
|
||||
($this->verifyAccessToItem)($file->folder_id, $shared);
|
||||
($this->verifyAccessToItem)($file->parent_id, $shared);
|
||||
}
|
||||
|
||||
// Check by single file permission
|
||||
|
||||
@@ -84,6 +84,6 @@ class ShareController extends Controller
|
||||
->delete();
|
||||
}
|
||||
|
||||
return response('Done!', 204);
|
||||
return response('Done.', 204);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ class ShareViaEmailController extends Controller
|
||||
token: $token,
|
||||
);
|
||||
|
||||
return response('Done!', 204);
|
||||
return response('Done.', 204);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user