diff options
author | Robin Appelman <robin@icewind.nl> | 2020-05-04 17:42:28 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-05-04 17:42:28 +0200 |
commit | 756fe45493fd3b82284abcedc51528542edc43bf (patch) | |
tree | d3f7467c9385f1732f9ee656f412bac9ece5f6d6 /lib/private/Share20/DefaultShareProvider.php | |
parent | afb12ddab173d10360cbbe370eb2e0cb922aa7b1 (diff) | |
download | nextcloud-server-756fe45493fd3b82284abcedc51528542edc43bf.tar.gz nextcloud-server-756fe45493fd3b82284abcedc51528542edc43bf.zip |
get only groupids in default share backend
instead of getting the full group object and then only using the id anyway
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Share20/DefaultShareProvider.php')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index ff46badee3b..c2de03ea689 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -888,7 +888,7 @@ class DefaultShareProvider implements IShareProvider { $cursor->closeCursor(); } elseif ($shareType === \OCP\Share::SHARE_TYPE_GROUP) { $user = $this->userManager->get($userId); - $allGroups = $this->groupManager->getUserGroups($user); + $allGroups = $this->groupManager->getUserGroupIds($user); /** @var Share[] $shares2 */ $shares2 = []; @@ -925,12 +925,7 @@ class DefaultShareProvider implements IShareProvider { } - $groups = array_filter($groups, function ($group) { - return $group instanceof IGroup; - }); - $groups = array_map(function (IGroup $group) { - return $group->getGID(); - }, $groups); + $groups = array_filter($groups); $qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP))) ->andWhere($qb->expr()->in('share_with', $qb->createNamedParameter( |