Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
dartcafe 2021-09-05 22:03:26 +02:00
Родитель d37b03b217
Коммит b7b39e84e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CCE73CEF3035D3C8
3 изменённых файлов: 2 добавлений и 30 удалений

Просмотреть файл

@ -26,7 +26,6 @@ namespace OCA\Polls\Controller;
use OCP\IRequest;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCA\Polls\Model\Group;
use OCA\Polls\Service\SettingsService;
class SettingsController extends Controller {
@ -40,7 +39,6 @@ class SettingsController extends Controller {
string $appName,
IRequest $request,
SettingsService $settingsService
) {
parent::__construct($appName, $request);
$this->settingsService = $settingsService;
@ -65,24 +63,4 @@ class SettingsController extends Controller {
return ['appSettings' => $this->settingsService->getAppSettings()];
});
}
/**
* Read user preferences
* @NoAdminRequired
*/
public function getUserSettings(): DataResponse {
return $this->response(function (): array {
return ['appSettings' => $this->settingsService->getUserSettings()];
});
}
/**
* Write user preferences
* @NoAdminRequired
*/
public function writeUserSettings(array $appSettings): DataResponse {
$this->settingsService->writeUserSettings($appSettings);
return $this->response(function (): array {
return ['appSettings' => $this->settingsService->getAppSettings()];
});
}
}

Просмотреть файл

@ -27,10 +27,6 @@ use JsonSerializable;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IUserSession;
use OCP\App\IAppManager;
use OCA\Circles\Api\v1\Circles;
use OCA\Circles\Model\Circle as CirclesCircle;
use OCA\Polls\Exceptions\CirclesNotEnabledException;
use OCA\Polls\AppInfo\Application;
class AppSettings implements JsonSerializable {
@ -100,7 +96,7 @@ class AppSettings implements JsonSerializable {
}
public function getAllAccessAllowed() {
return $this->getAllowAllAccess() || $this->isMember($this->getAllAccessGroups());
return $this->getAllowAllAccess() || $this->isMember($this->getAllAccessGroups());
}
public function getPublicSharesAllowed() {
@ -132,7 +128,7 @@ class AppSettings implements JsonSerializable {
$this->config->setAppValue(self::APP_NAME, 'pollCreationGroups', json_encode($value));
}
public function jsonSerialize() {
public function jsonSerialize() {
// convert group ids to group objects
$publicSharesGroups = [];
$allAccessGroups = [];

Просмотреть файл

@ -71,6 +71,4 @@ class SettingsService {
$app = \OC::$server->query(Application::class);
return $app->getContainer();
}
}