adasdadad
This commit is contained in:
@@ -24,7 +24,8 @@ final class AdminAppsService
|
||||
require_once AppPaths::systemAddonPath($this->projectRoot, 'gitea-deploy-status') . '/GiteaDeployStatusService.php';
|
||||
|
||||
$moduleRegistry = new ModuleRegistry(AppPaths::customAppsRoot($this->projectRoot));
|
||||
$appRegistry = new AppRegistry($this->projectRoot . '/config/apps.php', $moduleRegistry->desktopApps());
|
||||
$accessOverrides = AppAccessConfig::load($this->projectRoot);
|
||||
$appRegistry = new AppRegistry($this->projectRoot . '/config/apps.php', $moduleRegistry->desktopApps(), $accessOverrides);
|
||||
$widgetRegistry = new WidgetRegistry($this->projectRoot . '/config/widgets.php', $moduleRegistry->widgets());
|
||||
|
||||
$apps = $this->normalizeApps($appRegistry->all());
|
||||
@@ -37,6 +38,8 @@ final class AdminAppsService
|
||||
'meta' => [
|
||||
'environment' => $currentEnvironment,
|
||||
'gitea_config_path' => $this->environmentConfigPath('gitea', $currentEnvironment),
|
||||
'app_access_config_path' => $this->environmentConfigPath('app_access', $currentEnvironment),
|
||||
'available_groups' => AppAccessConfig::availableGroups($this->projectRoot),
|
||||
],
|
||||
'stats' => [
|
||||
'apps_total' => count($apps),
|
||||
@@ -85,6 +88,15 @@ final class AdminAppsService
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $requiredGroups
|
||||
* @return array<string, array{required_groups: array<int, string>}>
|
||||
*/
|
||||
public function saveAppAccess(string $appId, array $requiredGroups): array
|
||||
{
|
||||
return AppAccessConfig::saveRequiredGroups($this->projectRoot, $appId, $requiredGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, array<string, mixed>> $apps
|
||||
* @return array<int, array<string, mixed>>
|
||||
@@ -107,6 +119,7 @@ final class AdminAppsService
|
||||
'supports_tray' => !empty($app['supports_tray']),
|
||||
'enabled_by_default' => !empty($app['enabled_by_default']),
|
||||
'required_groups' => $requiredGroups,
|
||||
'required_groups_display' => $requiredGroups === [] ? 'Alle sichtbaren Benutzer' : implode(', ', $requiredGroups),
|
||||
'admin_only' => in_array('administrators', array_map(
|
||||
static fn (string $group): string => strtolower(trim($group, '/')),
|
||||
$requiredGroups
|
||||
|
||||
Reference in New Issue
Block a user