1
0
Files
breadcrumb-the-shire/modules/helpdesk/lib/Module/Helpdesk/Providers/HelpdeskLayoutProvider.php
fs a0d7670dd7 feat(helpdesk): align module with core list/drawer standards
- add helpdesk module pages, services, settings and tests

- standardize debtor list on drawer/grid contracts and robust filter drawer behavior

- add helpdesk aside panel navigation and settings visibility provider

- switch primary list slug to helpdesk/debitor and remove helpdesk/search compatibility

- include required core contract updates for list contracts and detail/drawer integration
2026-04-02 17:48:27 +02:00

30 lines
949 B
PHP

<?php
namespace MintyPHP\Module\Helpdesk\Providers;
use MintyPHP\App\AppContainer;
use MintyPHP\App\Module\Contracts\LayoutContextProvider;
use MintyPHP\Service\Access\AuthorizationService;
final class HelpdeskLayoutProvider implements LayoutContextProvider
{
public function provide(array $session, AppContainer $container): array
{
$userId = (int) ($session['user']['id'] ?? 0);
if ($userId <= 0) {
return ['helpdesk.nav' => ['can_manage_settings' => false]];
}
try {
$authorizationService = $container->get(AuthorizationService::class);
$canManageSettings = $authorizationService->authorize('helpdesk.settings.manage', [
'actor_user_id' => $userId,
])->isAllowed();
} catch (\Throwable) {
$canManageSettings = false;
}
return ['helpdesk.nav' => ['can_manage_settings' => $canManageSettings]];
}
}