forked from fa/breadcrumb-the-shire
fix(user-lifecycle): aside actions use normal size + repair policy ref link
Two small follow-ups to the cockpit phase-1 commit cc2cf3a:
* Drop the 'small' class from the three aside Quick Actions. The
aside has plenty of room and the small variant felt cramped next
to the page title — normal-size buttons match the visual weight
of the form's Save button above.
* Repair the Policy reference link. It pointed at a raw markdown
path (docs/reference-benutzer-lifecycle-policy.md) which 404s
because the static-file route never existed. The codebase has a
Markdown viewer at admin/docs/<slug> backed by DocsCatalogService;
the correct slug is 'reference-benutzer-lifecycle-policy'. Link
is now also gated by ABILITY_ADMIN_DOCS_VIEW so users without
docs permission don't see (and 403 on) it. target=_blank dropped
because it's an in-app route now, not an external file.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
use MintyPHP\Buffer;
|
use MintyPHP\Buffer;
|
||||||
use MintyPHP\Http\SessionStoreInterface;
|
use MintyPHP\Http\SessionStoreInterface;
|
||||||
use MintyPHP\Router;
|
use MintyPHP\Router;
|
||||||
|
use MintyPHP\Service\Access\OperationsAuthorizationPolicy;
|
||||||
use MintyPHP\Service\Access\SettingsAuthorizationPolicy;
|
use MintyPHP\Service\Access\SettingsAuthorizationPolicy;
|
||||||
use MintyPHP\Service\Audit\NullUserLifecycleAuditDashboard;
|
use MintyPHP\Service\Audit\NullUserLifecycleAuditDashboard;
|
||||||
use MintyPHP\Service\Audit\UserLifecycleAuditDashboardInterface;
|
use MintyPHP\Service\Audit\UserLifecycleAuditDashboardInterface;
|
||||||
@@ -160,6 +161,10 @@ $kpiTiles = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// ── Aside quick actions ──────────────────────────────────────────────
|
// ── Aside quick actions ──────────────────────────────────────────────
|
||||||
|
$canViewDocs = $authorizationService
|
||||||
|
->authorize(OperationsAuthorizationPolicy::ABILITY_ADMIN_DOCS_VIEW, ['actor_user_id' => $currentUserId])
|
||||||
|
->isAllowed();
|
||||||
|
|
||||||
/** @var array<int, array<string, mixed>> $asideActions */
|
/** @var array<int, array<string, mixed>> $asideActions */
|
||||||
$asideActions = [];
|
$asideActions = [];
|
||||||
if ($canUpdateSettings) {
|
if ($canUpdateSettings) {
|
||||||
@@ -168,7 +173,7 @@ if ($canUpdateSettings) {
|
|||||||
'label' => t('Run policy now'),
|
'label' => t('Run policy now'),
|
||||||
'action' => 'admin/settings/run-user-lifecycle',
|
'action' => 'admin/settings/run-user-lifecycle',
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'class' => 'secondary outline small',
|
'class' => 'secondary outline',
|
||||||
'tone' => 'danger',
|
'tone' => 'danger',
|
||||||
'confirm' => t('Run user lifecycle now?'),
|
'confirm' => t('Run user lifecycle now?'),
|
||||||
'detailActionKind' => 'danger',
|
'detailActionKind' => 'danger',
|
||||||
@@ -180,20 +185,20 @@ if ($canUpdateSettings && $auditDashboardActive) {
|
|||||||
'label' => t('Purge logs'),
|
'label' => t('Purge logs'),
|
||||||
'action' => 'admin/settings/user-lifecycle/audit-purge',
|
'action' => 'admin/settings/user-lifecycle/audit-purge',
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'class' => 'secondary outline small',
|
'class' => 'secondary outline',
|
||||||
'tone' => 'danger',
|
'tone' => 'danger',
|
||||||
'confirm' => t('Purge old user lifecycle audit log entries?'),
|
'confirm' => t('Purge old user lifecycle audit log entries?'),
|
||||||
'detailActionKind' => 'purge',
|
'detailActionKind' => 'purge',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$asideActions[] = [
|
if ($canViewDocs) {
|
||||||
'type' => 'link',
|
$asideActions[] = [
|
||||||
'label' => t('Policy reference'),
|
'type' => 'link',
|
||||||
'href' => 'docs/reference-benutzer-lifecycle-policy.md',
|
'label' => t('Policy reference'),
|
||||||
'class' => 'secondary outline small',
|
'href' => 'admin/docs/reference-benutzer-lifecycle-policy',
|
||||||
'target' => '_blank',
|
'class' => 'secondary outline',
|
||||||
'rel' => 'noopener',
|
];
|
||||||
];
|
}
|
||||||
|
|
||||||
Buffer::set('title', t('User lifecycle settings'));
|
Buffer::set('title', t('User lifecycle settings'));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user