Refine branding labels and access checks
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-15 08:51:06 +01:00
parent 8634d16359
commit 725a7a29b3
5 changed files with 66 additions and 16 deletions

View File

@@ -92,7 +92,28 @@ export function resolveEngagementMode(event?: TenantEvent | null): 'tasks' | 'ph
export function isBrandingAllowed(event?: TenantEvent | null): boolean {
if (!event) return true;
return Boolean((event.package as any)?.branding_allowed ?? true);
const settings = (event.settings ?? {}) as Record<string, unknown>;
const packageAllowed = (event.package as any)?.branding_allowed;
if (packageAllowed === false) {
return false;
}
if (typeof settings.branding_allowed === 'boolean') {
return settings.branding_allowed;
}
return true;
}
export function isWatermarkAllowed(event?: TenantEvent | null): boolean {
if (!event) return true;
const settings = (event.settings ?? {}) as Record<string, unknown>;
const packageAllowed = (event.package as any)?.watermark_allowed;
if (packageAllowed === false) {
return false;
}
if (typeof settings.watermark_allowed === 'boolean') {
return settings.watermark_allowed;
}
return true;
}
export function formatEventStatusLabel(