Add an endpoint that grants a person access to a project - #336
Merged
Merged
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
POST /v1/projects/{slug}/members grants a member a role (project.manage),
by email. It is additive: unlike the owner PATCH, which sets exactly the two
accountable owners and would displace one to add a third person, this adds a
member without touching the owners -- so someone can hold full access
alongside the owner and backup. role defaults to project_lead ("full project
context and execution within policy", i.e. full access) and is restricted to
the project roles (project_lead, backup_operator, contributor, observer); the
org-level roles are refused. Idempotent via ON CONFLICT DO NOTHING.
Also makes SetProjectOwners' membership sync targeted: it removes only the
outgoing owners' project_lead/backup_operator rows rather than every lead, so
an additional full-access member granted through the new endpoint survives a
later owner change instead of being silently revoked.
Membership is runtime data, not schema, so this is the endpoint that changes
it, mirroring SetProjectOwners and SetProjectCell.
Adds a ManageMembers control to the web admin, the api.addMember client, the
OpenAPI operation, the route-action entry, and a nil-db validation test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
anuveyatsu
force-pushed
the
bead/jopacc-members-grant
branch
from
September 25, 2026 09:07
523bcc6 to
e6604a0
Compare
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
POST /v1/projects/{slug}/membersgrants a person a role on a project, by email (project.manage). It is additive: unlikePATCH /v1/projects/{slug}(which sets exactly the two accountable owners and would displace one to add a third person), this adds a member without touching the owners — so someone can hold full access alongside the owner and backup.roledefaults toproject_lead("full project context and execution within policy", i.e. full access) and is restricted to the project roles (project_lead,backup_operator,contributor,observer); org-level roles are refused.ON CONFLICT DO NOTHING— a repeat grant is a no-op.Why
Granting access is runtime data, not schema — a person's email is a business record the disclosure guard refuses in the public repo — so it belongs behind an endpoint, mirroring
SetProjectOwnersandSetProjectCell. The immediate driver: grant a third person full access to the JoPACC project without displacing its owner/backup.Also
Makes
SetProjectOwners' membership sync targeted: it removes only the outgoing owners'project_lead/backup_operatorrows rather than every lead, so an additional full-access member granted through this endpoint survives a later owner change instead of being silently revoked.Surface
Domain method + targeted-delete fix, control-api handler, route-action entry (
project.manage), OpenAPI operation,api.addMemberclient,ManageMembersweb control, nil-db validation test.Command run
```
go build ./... && go vet ./internal/domain/ ./cmd/control-api/ && go test ./internal/domain/ ./cmd/control-api/
```
Output:
```
ok github.com/datopian/openbases/internal/domain 0.436s
ok github.com/datopian/openbases/cmd/control-api 0.640s
```
Web: `tsc --noEmit && vite build` → built in 342ms.
🤖 Generated with Claude Code
Summary by CodeRabbit