Skip to content

Make profile editing a toggleable permission#81

Open
markgoho wants to merge 5 commits into
trunkfrom
feat/profile-editing-permission
Open

Make profile editing a toggleable permission#81
markgoho wants to merge 5 commits into
trunkfrom
feat/profile-editing-permission

Conversation

@markgoho
Copy link
Copy Markdown
Owner

Summary

  • replace the runtime profileApprovedAt gate with allowProfileEditing across functions and members
  • add admin toggle UI, member route protection, and a backfill script for legacy approved members
  • update targeted functions and members specs for the new permission model

Test plan

  • rtk bun test /Users/mgoho/Github/doula-cooperative/functions/src/admin-members-api/routes/approve-profile.test.ts /Users/mgoho/Github/doula-cooperative/functions/src/admin-members-api/routes/link-profile.test.ts /Users/mgoho/Github/doula-cooperative/functions/src/profiles-api/routes/create-profile.test.ts /Users/mgoho/Github/doula-cooperative/functions/src/profiles-api/routes/write-profile.test.ts
  • rtk bun test /Users/mgoho/Github/doula-cooperative/members/src/app/admin/users/admin-member-detail/admin-member-detail.spec.ts /Users/mgoho/Github/doula-cooperative/members/src/app/membership/membership.spec.ts /Users/mgoho/Github/doula-cooperative/members/src/app/header/header.spec.ts /Users/mgoho/Github/doula-cooperative/members/src/app/guards/profile-editing.guard.integration.spec.ts (currently blocked by an existing Angular router/JIT test-runner issue in this repo)

🤖 Generated with Claude Code

markgoho and others added 4 commits March 25, 2026 16:55
Use allowProfileEditing as the runtime gate for member profile access so admins can toggle profile editing on and off without relying on a one-time approval timestamp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preserve auth checks on profile routes while returning allowProfileEditing consistently across the member API and related tests. Also clean up admin-member-detail coverage and make the backfill safer for existing approved members.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update the profile creation and edit-profile E2E specs to navigate through the membership UI and keep mocked member documents in sync with slug and profile state changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update the remaining E2E member API mocks to include allowProfileEditing so the CI e2e typecheck matches the current API contract.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

Visit the preview URL for this PR (updated for commit c4d37e4):

https://doula-coop-members--pr81-feat-profile-editing-4q1kfjyj.web.app

(expires Thu, 02 Apr 2026 15:34:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a71d87896e6e52770e2104660c7490f8b9727d99

Prevent profile-editing guard redirects while member data is still loading, strengthen the admin profile-editing route tests, and convert the editing-permission backfill into a runnable script with clear local-emulator behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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