Fix: Breeder-Chips nie aus Sicherheitsnetz erzwingen — nur Admin/Mod/Social (SW by-v743)
This commit is contained in:
parent
4a4e98ea6f
commit
4009a1d2a7
5 changed files with 9 additions and 9 deletions
|
|
@ -594,15 +594,15 @@ window.Worlds = (() => {
|
|||
|
||||
function _chipsForWorld(world) {
|
||||
const pages = _getConfig()[world] || _DEFAULT_CONFIG[world];
|
||||
// Alle Chips filtern — _chipAllowed entscheidet ob angezeigt
|
||||
const chips = pages.map(_chipMeta).filter(c => c && _chipAllowed(c));
|
||||
// Sicherheitsnetz: Rolle-gebundene Chips immer einfügen wenn berechtigt
|
||||
const u = _state?.user;
|
||||
// Sicherheitsnetz: Admin/Mod/Social-Chips aus Default immer einfügen wenn berechtigt
|
||||
// (nicht Breeder — der folgt strikt dem Tier)
|
||||
const alreadyIn = new Set(chips.map(c => c.page));
|
||||
const defaults = _DEFAULT_CONFIG[world] || [];
|
||||
for (const page of defaults) {
|
||||
for (const page of (_DEFAULT_CONFIG[world] || [])) {
|
||||
if (alreadyIn.has(page)) continue;
|
||||
const meta = _chipMeta(page);
|
||||
if (!meta?.role) continue; // nur role-gebundene Chips
|
||||
if (!meta?.role || meta.role === 'breeder') continue; // Breeder nie erzwingen
|
||||
if (_chipAllowed(meta)) { chips.push(meta); alreadyIn.add(page); }
|
||||
}
|
||||
return chips;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue