hide shared files located in group folder's trash bin

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2023-03-28 13:48:43 +02:00 committed by backportbot-nextcloud[bot]
parent 53cced8439
commit f5681c8d53

View file

@ -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
@ -887,6 +888,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;
}