Skip to content

fix: Unify web admin access with aao-admin working group#833

Merged
bokelley merged 1 commit into
mainfrom
bokelley/admin-access-fix
Jan 20, 2026
Merged

fix: Unify web admin access with aao-admin working group#833
bokelley merged 1 commit into
mainfrom
bokelley/admin-access-fix

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Web admin access now checks aao-admin working group membership as primary method (with ADMIN_EMAILS as fallback)
  • Added cache invalidation when working group membership changes so admin status updates take effect immediately

Problem

Previously there were two separate admin systems:

  1. Web admin - checked ADMIN_EMAILS env var
  2. Slack/Addie admin - checked aao-admin working group membership

This 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 admin
  • server/src/routes/committees.ts - Invalidate admin cache on membership changes
  • server/src/slack/sync.ts - Invalidate admin cache on Slack sync
  • server/src/slack/events.ts - Invalidate admin cache on real-time Slack events
  • server/src/addie/mcp/admin-tools.ts - Invalidate admin cache when adding/removing leaders

Test plan

  • Non-admin user gets 403 on admin endpoints
  • User in aao-admin working group can access admin endpoints
  • Admin status updates immediately when added/removed from aao-admin

🤖 Generated with Claude Code

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>
@bokelley bokelley merged commit 831b7e6 into main Jan 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant