fix(members): repair broken member-directory visibility gate
member_directory_visibility is the directory_visibility enum (board_only|member_count_visible|members_visible|public_members_visible), but the gate compared against 'board_visible'/'admin_only' — values from other enums that never match — so every setting except members_visible silently restricted the directory, including public_members_visible (meant to be the most open). Map the gate to the real enum values. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
da11127ca4
commit
70b85a20fa
@@ -34,10 +34,17 @@ export default async function MembersPage() {
|
||||
const isAdmin = self.role === 'admin'
|
||||
const isElevated = ELEVATED_ROLES.has(self.role)
|
||||
|
||||
// member_directory_visibility is the `directory_visibility` enum. The gate
|
||||
// previously compared against 'board_visible'/'admin_only' — values from
|
||||
// OTHER enums that never match — so every setting except 'members_visible'
|
||||
// silently restricted the directory (including 'public_members_visible',
|
||||
// which should be the most open). Map to the real enum values:
|
||||
// - members_visible / public_members_visible: any authenticated member
|
||||
// - board_only / member_count_visible: only elevated roles see the full list
|
||||
const allowed =
|
||||
visibility === 'members_visible' ||
|
||||
(visibility === 'board_visible' && isElevated) ||
|
||||
(visibility === 'admin_only' && isAdmin)
|
||||
visibility === 'public_members_visible' ||
|
||||
((visibility === 'board_only' || visibility === 'member_count_visible') && isElevated)
|
||||
|
||||
if (!allowed) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user