Merge pull request #3307 from nextcloud/backport/3299/stable1.4

This commit is contained in:
Julius Härtl
2021-09-08 18:42:20 +02:00
committed by GitHub

View File

@@ -73,16 +73,20 @@ class ConfigService {
if (!$this->groupManager->isAdmin($this->userId)) { if (!$this->groupManager->isAdmin($this->userId)) {
throw new NoPermissionException('You must be admin to get the group limit'); throw new NoPermissionException('You must be admin to get the group limit');
} }
$result = $this->getGroupLimit(); return $this->getGroupLimit();
break;
case 'calendar': case 'calendar':
$result = (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true); if ($this->userId === null) {
break; return false;
}
return (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true);
} }
return $result;
} }
public function isCalendarEnabled(int $boardId = null): bool { public function isCalendarEnabled(int $boardId = null): bool {
if ($this->userId === null) {
return false;
}
$defaultState = (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true); $defaultState = (bool)$this->config->getUserValue($this->userId, Application::APP_ID, 'calendar', true);
if ($boardId === null) { if ($boardId === null) {
return $defaultState; return $defaultState;