fix: Unify web admin access with aao-admin working group#833
Merged
Conversation
Previously, web admin access was determined by the ADMIN_EMAILS environment variable, while Slack/Addie admin access was determined by membership in the aao-admin working group. This caused confusion when adding users to the AAO Administration working group - they'd get Addie admin access but not web admin. Changes: - Web admin access now checks aao-admin working group membership (primary) with ADMIN_EMAILS as a fallback for emergency access - Add cache invalidation when working group membership changes to ensure admin status updates take effect immediately (was cached for 30 min) Cache invalidation added to: - routes/committees.ts: admin add/remove, self-join, self-leave - slack/sync.ts: bulk sync and channel join sync - slack/events.ts: real-time Slack channel join - addie/mcp/admin-tools.ts: add/remove committee leaders via Addie Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aao-adminworking group membership as primary method (withADMIN_EMAILSas fallback)Problem
Previously there were two separate admin systems:
ADMIN_EMAILSenv varaao-adminworking group membershipThis caused confusion - adding someone to the "AAO Administration" working group gave them Addie admin access but not web admin access.
Changes
server/src/middleware/auth.ts- Check working group membership for web adminserver/src/routes/committees.ts- Invalidate admin cache on membership changesserver/src/slack/sync.ts- Invalidate admin cache on Slack syncserver/src/slack/events.ts- Invalidate admin cache on real-time Slack eventsserver/src/addie/mcp/admin-tools.ts- Invalidate admin cache when adding/removing leadersTest plan
aao-adminworking group can access admin endpointsaao-admin🤖 Generated with Claude Code