add a function getUserGroupIds for retrieving group ids instead of group objects. this significantly improves performance when using many (nested) groups.
$this->cachedUserGroups[$uid] = array_values($groups);
return $this->cachedUserGroups[$uid];
}
+ /**
+ * @param \OC\User\User $user
+ * @return array with group names
+ */
+ public function getUserGroupIds($user) {
+ $groupIds = array();
+ foreach ($this->backends as $backend) {
+ $groupIds = array_merge($groupIds,$backend->getUserGroups($user->getUID()));
+
+ }
+ return $groupIds;
+ }
/**
* get a list of all display names in a group