fix(projects): add the creator as a project admin on create - #253
Conversation
Creating a project only inserted the projects row, so a regular workspace member who created a project got no project_members row and was then blocked from its admin-only settings (requireProjectAdmin needs project admin or a workspace admin). Project creation now inserts the creator as a project admin alongside the project in one transaction. Closes #125 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Strix Security ReviewNo security issues found. Updated for Reviewed by Strix |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughProject creation now creates a ChangesCreator membership on project creation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
What
Closes #125. Creating a project only inserted the
projectsrow and never aproject_membersrow for the creator. A regular workspace member who created a project was then blocked from its own admin-only settings, sincerequireProjectAdminneeds the caller to be a project admin or a workspace admin.How
ProjectService.Createnow inserts the creator as a project admin alongside the project. The newProjectStore.CreateWithCreatorMemberdoes both writes in one transaction, so a project can never exist without its creator being able to manage it. Workspace admins/owners are unaffected (they could already manage any project).Testing
New
internal/handler/project_create_member_test.go:project_membersrow with at least admin role, and can immediately PATCH the project settings (previously 403).Full
go test ./internal/handler ./internal/servicegreen (no regressions).AI assistance
Produced with the help of Claude Code (Claude Opus 4.8). AI-assisted commits carry a
Co-Authored-Bytrailer.Summary by CodeRabbit
New Features
Bug Fixes