23 lines
1.0 KiB
PHP
23 lines
1.0 KiB
PHP
<?php
|
|
// app/assets/utils/app_registry.php
|
|
//
|
|
// The apps a user can be given access to (user.app_access and
|
|
// company_map_user.app_access), with the label, icon and badge colour the
|
|
// Users Access page shows for each.
|
|
//
|
|
// config.php may define its own $app_registry; this file only fills it in when
|
|
// it is missing or empty — which is every Docker-generated config.php written
|
|
// before the setting was documented. Without it the Add User dialog breaks
|
|
// (Object.entries(null) in setting/users.php) and inviting a user fails
|
|
// (array_keys(null) in setting/api/engine/manage_users.php).
|
|
//
|
|
// Keys must stay within the user.app_access enum: 'wms' and 'accounting'
|
|
// ('all' is implied and never listed here).
|
|
|
|
if (!isset($app_registry) || !is_array($app_registry) || !$app_registry) {
|
|
$app_registry = [
|
|
'wms' => ['label' => 'WMS', 'icon' => 'ti-box', 'color' => 'bg-label-primary'],
|
|
'accounting' => ['label' => 'Accounting', 'icon' => 'ti-calculator', 'color' => 'bg-label-success'],
|
|
];
|
|
}
|