Gate event creation to coordinators (sevak+)#503
Open
KishParikh13 wants to merge 1 commit into
Open
Conversation
Only sevak-and-above (or global admins) can create events. Beta pilot coordinators (e.g. San Jose / Dallas) are provisioned at SEVAK; they invite normal members to their center, who can RSVP and join boards but not create events. - backend: /addEvent rejects below-SEVAK callers with 403 - frontend: hide the "Create" entry point on Discover (native, desktop web, and the mobile-web fallback) for non-coordinators; mirrors the backend gate via isSevakOrAdmin() - replaces the temporary "beta: any signed-in user can create" scaffolding - tests: promote event-creating fixtures to SEVAK; add a 403 negative test for a normal member Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying chinmaya-janata with
|
| Latest commit: |
c66ec5e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2f36a412.project-janatha.pages.dev |
| Branch Preview URL: | https://feat-admins-only-event-creat.project-janatha.pages.dev |
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.
What
Locks event creation to coordinators (verification_level ≥ SEVAK / 54) or global admins. This implements the beta decision: only admins create events; pilot coordinators (San Jose / Dallas) get admin access and invite normal members to their center.
Previously any signed-in user saw the "Create" button — that was temporary beta scaffolding (
explore.web.tsxliterally said "Beta: any signed-in user can create events… post-beta this becomes a coordinator-tier gate"). This turns the gate on.Changes
POST /addEvent: rejects below-SEVAK callers with403(admins still allowed).isSevakOrAdmin(user)— covers all three entry points:app/(tabs)/explore.tsx(native)app/(tabs)/explore.web.tsx(desktop web)components/explore/MobileDiscoverFallback.web.tsx(mobile web)403.Notes
Test plan
npm run typecheck(backend + frontend) cleannpm run testbackend — 432 passing (incl. new 403 test)