Merge pull request #770 from nextcloud/bugfix/noid/permission-groups

Check group limit in the proper way
This commit is contained in:
Julius Härtl
2018-12-07 23:32:41 +01:00
committed by GitHub

View File

@@ -248,13 +248,16 @@ class PermissionService {
public function canCreate() { public function canCreate() {
$groups = $this->getGroupLimitList(); $groups = $this->getGroupLimitList();
if (count($groups) === 0) {
return true;
}
foreach ($groups as $group) { foreach ($groups as $group) {
if ($this->groupManager->isInGroup($this->userId, $group)) { if ($this->groupManager->isInGroup($this->userId, $group)) {
return false;
}
}
return true; return true;
} }
}
return false;
}
private function getGroupLimitList() { private function getGroupLimitList() {
$value = $this->config->getAppValue('deck', 'groupLimit', ''); $value = $this->config->getAppValue('deck', 'groupLimit', '');