Fix: Rolle-gebundene Chips (Admin/Mod/Social) immer sichtbar unabhängig von persönlicher Config (SW by-v742)

This commit is contained in:
rene 2026-05-06 19:36:44 +02:00
parent ed9c482ae5
commit 4a4e98ea6f
5 changed files with 16 additions and 5 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '741'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '742'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
const IS_STAGING = location.hostname === 'staging.banyaro.app';

View file

@ -594,7 +594,18 @@ window.Worlds = (() => {
function _chipsForWorld(world) {
const pages = _getConfig()[world] || _DEFAULT_CONFIG[world];
return pages.map(_chipMeta).filter(c => c && _chipAllowed(c));
const chips = pages.map(_chipMeta).filter(c => c && _chipAllowed(c));
// Sicherheitsnetz: Rolle-gebundene Chips immer einfügen wenn berechtigt
const u = _state?.user;
const alreadyIn = new Set(chips.map(c => c.page));
const defaults = _DEFAULT_CONFIG[world] || [];
for (const page of defaults) {
if (alreadyIn.has(page)) continue;
const meta = _chipMeta(page);
if (!meta?.role) continue; // nur role-gebundene Chips
if (_chipAllowed(meta)) { chips.push(meta); alreadyIn.add(page); }
}
return chips;
}
// ── KONFIGURATIONS-MODAL ─────────────────────────────────────