diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-21 11:36:28 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-06-21 11:36:28 +0200 |
commit | ca168265ef04c3ea1b5be468697fa4b55d1e6b38 (patch) | |
tree | afeda811c64f699a17874c16de0667588dbe97f1 /apps/files_sharing/lib/MountProvider.php | |
parent | 0e575c7eeadc6c8eb11b0be2ed1d39cdcf6cfcb8 (diff) | |
download | nextcloud-server-ca168265ef04c3ea1b5be468697fa4b55d1e6b38.tar.gz nextcloud-server-ca168265ef04c3ea1b5be468697fa4b55d1e6b38.zip |
Filter out group shares for owner where owner is included (#25190)
Diffstat (limited to 'apps/files_sharing/lib/MountProvider.php')
-rw-r--r-- | apps/files_sharing/lib/MountProvider.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index a9ae48860c2..c71c0e8ddea 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -68,8 +68,9 @@ class MountProvider implements IMountProvider { public function getMountsForUser(IUser $user, IStorageFactory $storageFactory) { $shares = $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_USER, null, -1); $shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_GROUP, null, -1)); - $shares = array_filter($shares, function (\OCP\Share\IShare $share) { - return $share->getPermissions() > 0; + // filter out excluded shares and group shares that includes self + $shares = array_filter($shares, function (\OCP\Share\IShare $share) use ($user) { + return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID(); }); $mounts = []; |