diff --git a/lib/BackgroundJob/EnableAppsForGroup.php b/lib/BackgroundJob/EnableAppsForGroup.php index 801d5c7..7265d01 100644 --- a/lib/BackgroundJob/EnableAppsForGroup.php +++ b/lib/BackgroundJob/EnableAppsForGroup.php @@ -31,10 +31,15 @@ protected function run($argument): void { } foreach ($this->appIds as $appId) { $appId = $this->appManager->cleanAppId($appId); - $enabled = $this->appConfig->getValueArray($appId, 'enabled', []); - if (!in_array($this->groupId, $enabled)) { - $enabled[] = $this->groupId; - $this->appManager->enableAppForGroups($appId, $enabled); + $toSave = $enabled = $this->appConfig->getValueArray($appId, 'enabled', []); + if (!in_array($this->groupId, $toSave)) { + $toSave[] = $this->groupId; + } + if (!in_array('admin', $toSave)) { + $toSave[] = 'admin'; + } + if ($enabled !== $toSave) { + $this->appManager->enableAppForGroups($appId, $toSave); } } }