summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/group/metadata.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/group/metadata.php b/lib/private/group/metadata.php
index 57abbe20c64..687a735347c 100644
--- a/lib/private/group/metadata.php
+++ b/lib/private/group/metadata.php
@@ -168,7 +168,21 @@ class MetaData {
if($this->isAdmin) {
return $this->groupManager->search($search);
} else {
- return \OC_SubAdmin::getSubAdminsGroups($this->user);
+ $groupIds = \OC_SubAdmin::getSubAdminsGroups($this->user);
+
+ /* \OC_SubAdmin::getSubAdminsGroups() returns an array of GIDs, but this
+ * method is expected to return an array with the GIDs as keys and group objects as
+ * values, so we need to convert this information.
+ */
+ $groups = array();
+ foreach($groupIds as $gid) {
+ $group = $this->groupManager->get($gid);
+ if (!is_null($group)) {
+ $groups[$gid] = $group;
+ }
+ }
+
+ return $groups;
}
}
}