Skip to content

Commit 8e015ae

Browse files
committed
chore: default libresign setting
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 7d0a2f2 commit 8e015ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/BackgroundJob/EnableAppsForGroup.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,22 @@ protected function run($argument): void {
4141
if ($enabled !== $toSave) {
4242
$this->appManager->enableAppForGroups($appId, $toSave);
4343
}
44+
$this->enableLibreSign($appId);
4445
}
4546
}
4647

48+
private function enableLibreSign(string $appId): void {
49+
if ($appId !== 'libresign') {
50+
return;
51+
}
52+
$authorized = $this->appConfig->getValueArray('libresign', 'groups_request_sign', ['admin']);
53+
if (in_array($this->groupId, $authorized)) {
54+
return;
55+
}
56+
$authorized[] = $this->groupId;
57+
$this->appConfig->setValueArray('libresign', 'groups_request_sign', $authorized);
58+
}
59+
4760
private function validateAndProccessArguments($argument): bool {
4861
if (!isset($argument['groupId'])) {
4962
return false;

0 commit comments

Comments
 (0)