diff --git a/docs/moderation/README.md b/docs/moderation/README.md index 528bae17..3c4f941b 100644 --- a/docs/moderation/README.md +++ b/docs/moderation/README.md @@ -6,7 +6,7 @@ bitvid is follow-centric. Your Home feed comes from people you follow (F1). Disc ## Core principles - **Freedom to choose**: User picks filters. Defaults are safe but reversible. - **Explain decisions**: Every blur/hide shows a “why” badge and a “show anyway” control. -- **Whitelist > blacklist**: Prefer showing content from trusted networks over fighting global spam. +- **Blacklist > whitelist**: Admin blacklists and moderation gates always win; whitelists only influence Discovery ranking. - **Minimal central power**: Admin lists are opt-in; users can unsubscribe. ## Threat model (short) @@ -67,7 +67,7 @@ Operators can delegate hard-hide decisions to trusted curators without giving th 1. The super admin maintains a `kind 30000` list with `d=${ADMIN_LIST_NAMESPACE}:${ADMIN_COMMUNITY_BLACKLIST_SOURCES}`. Each `a` tag references a community curator’s blacklist as `30000::${ADMIN_LIST_NAMESPACE}:${ADMIN_COMMUNITY_BLACKLIST_PREFIX}:`. 2. Every curator publishes their own `kind 30000` list using the referenced `d` tag (`${ADMIN_LIST_NAMESPACE}:${ADMIN_COMMUNITY_BLACKLIST_PREFIX}:`) and fills it with `p` tags for accounts they want hidden. -3. bitvid automatically fetches each referenced list, merges the entries into the global blacklist, and removes any duplicates or guard-protected accounts (super admin, editors, or whitelist members). +3. bitvid automatically fetches each referenced list, merges the entries into the global blacklist, and removes any duplicates or guard-protected accounts (super admin or editors). To add a community list, append a new `a` tag to the super-admin source list and ask the curator to publish their companion `p` list. To remove a list, delete the `a` tag or ask the curator to clear their `p` entries; the client stops ingesting it on the next refresh. diff --git a/js/accessControl.js b/js/accessControl.js index 7d163ac1..0e0f4b70 100644 --- a/js/accessControl.js +++ b/js/accessControl.js @@ -265,7 +265,6 @@ class AccessControl { const whitelistChanged = !areSetsEqual(previousWhitelist, this.whitelist); const blacklistDedupe = dedupeNpubs(blacklist); - const whitelistSet = new Set(normalizedWhitelist.map(normalizeNpub)); const adminGuardSet = new Set([ normalizeNpub(ADMIN_SUPER_NPUB), ...Array.from(this.editors), @@ -275,9 +274,6 @@ class AccessControl { if (!normalized) { return false; } - if (whitelistSet.has(normalized)) { - return false; - } if (adminGuardSet.has(normalized)) { return false; } @@ -698,15 +694,9 @@ class AccessControl { if (!normalized) { return false; } - if (this.whitelist.has(normalized)) { - return false; - } const normalizedHexCandidate = normalizeHexKey(normalized); if (normalizedHexCandidate) { - if (this.whitelistPubkeys.has(normalizedHexCandidate)) { - return false; - } return this.blacklistPubkeys.has(normalizedHexCandidate); } @@ -754,14 +744,14 @@ class AccessControl { return false; } - if (this.whitelistPubkeys.has(hex)) { - return true; - } - if (this.blacklistPubkeys.has(hex)) { return false; } + if (this.whitelistPubkeys.has(hex)) { + return true; + } + if (this.whitelistEnabled && !this.whitelistPubkeys.has(hex)) { return false; } @@ -778,22 +768,22 @@ class AccessControl { } if (hex) { - if (this.whitelistPubkeys.has(hex)) { - return true; - } if (this.blacklistPubkeys.has(hex)) { return false; } - } - - if (this.whitelist.has(normalized)) { - return true; + if (this.whitelistPubkeys.has(hex)) { + return true; + } } if (this.blacklist.has(normalized)) { return false; } + if (this.whitelist.has(normalized)) { + return true; + } + if (this.whitelistEnabled && !this.whitelist.has(normalized)) { return false; }