diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-05-08 12:25:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 12:25:51 +0300 |
commit | 131b1fa45876a6e11a60ed60a24bb2b3becf637f (patch) | |
tree | 96efd725d30a2541ab6c54d7a555239792aece1a /lib | |
parent | 1d588f67a3fd4e213e6fff85cef25ee710bf465f (diff) | |
parent | 16f4b43d94229aaaeefe5c5ae5c2bc44196cef4e (diff) |
Merge pull request #20815 from nextcloud/share-groupid-only
get only groupids in default share backend
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index ff46badee3b..98ca747a894 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -44,7 +44,6 @@ use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\IDBConnection; -use OCP\IGroup; use OCP\IGroupManager; use OCP\IL10N; use OCP\IURLGenerator; @@ -888,7 +887,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 +924,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( |