Merge pull request #37448 from nextcloud/fix/12281/hide-deleted-shared-groupfolder-files

hide shared files located in group folder's trash bin
pull/37452/head
Arthur Schiwon 2023-03-30 10:31:16 +07:00 committed by GitHub
commit 488dde12cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

@ -55,6 +55,7 @@ use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IAttributes;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use function str_starts_with;
/**
* Class DefaultShareProvider
@ -885,6 +886,11 @@ class DefaultShareProvider implements IShareProvider {
if ($pathSections[0] !== 'files'
&& (strpos($data['storage_string_id'], 'home::') === 0 || strpos($data['storage_string_id'], 'object::user') === 0)) {
return false;
} elseif ($pathSections[0] === '__groupfolders'
&& str_starts_with($pathSections[1], 'trash/')
) {
// exclude shares leading to trashbin on group folders storages
return false;
}
return true;
}