diff --git a/lib/BackgroundJob/EnableAppsForGroup.php b/lib/BackgroundJob/EnableAppsForGroup.php index 7265d01..1e13bf0 100644 --- a/lib/BackgroundJob/EnableAppsForGroup.php +++ b/lib/BackgroundJob/EnableAppsForGroup.php @@ -41,9 +41,22 @@ protected function run($argument): void { if ($enabled !== $toSave) { $this->appManager->enableAppForGroups($appId, $toSave); } + $this->enableLibreSign($appId); } } + private function enableLibreSign(string $appId): void { + if ($appId !== 'libresign') { + return; + } + $authorized = $this->appConfig->getValueArray('libresign', 'groups_request_sign', ['admin']); + if (in_array($this->groupId, $authorized)) { + return; + } + $authorized[] = $this->groupId; + $this->appConfig->setValueArray('libresign', 'groups_request_sign', $authorized); + } + private function validateAndProccessArguments($argument): bool { if (!isset($argument['groupId'])) { return false;