M1 (9): dashboard alerts by role

IntegrationAlerts reads the admin-only Site integrations global with access
control off and showed its error texts to everyone who opened the dashboard.
Now: an admin sees what is failing and the link, an editor a neutral "an
integration needs attention — ask an administrator", anyone else nothing.
CookieCrawlAlert is shown to editors and above (the role that may read the crawl
result). Both use userMeetsRole, so a session that still owes its second factor
sees neither. dashboardAlerts: { integrations: 'admin' | 'editor' | 'all',
cookies: 'editor' | 'all' } loosens it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 00:39:12 +01:00
co-authored by Claude Fable 5.2
parent 5d35b2c3f4
commit 0b4c4e8295
7 changed files with 173 additions and 13 deletions
+2 -2
View File
@@ -755,7 +755,7 @@ export const ipalKit = (options: IpalOptions): Plugin => {
...(config.admin?.components ?? {}),
beforeDashboard: [
...(config.admin?.components?.beforeDashboard ?? []),
{ path: '@intecion/ipal-kit/admin#CookieCrawlAlert', serverProps: { adminRoute, approval: alertApproval, crawl: alertCrawl, labels } },
{ path: '@intecion/ipal-kit/admin#CookieCrawlAlert', serverProps: { adminRoute, approval: alertApproval, crawl: alertCrawl, labels, ...(options.dashboardAlerts?.cookies ? { audience: options.dashboardAlerts.cookies } : {}) } },
],
},
}
@@ -823,7 +823,7 @@ export const ipalKit = (options: IpalOptions): Plugin => {
...(config.admin?.components?.beforeDashboard ?? []),
{
path: '@intecion/ipal-kit/admin#IntegrationAlerts',
serverProps: { adminRoute: options.adminRoute ?? '/admin' },
serverProps: { adminRoute: options.adminRoute ?? '/admin', ...(options.dashboardAlerts?.integrations ? { details: options.dashboardAlerts.integrations } : {}) },
},
],
},