fix: scope card member assignments to the workspace - #576
Merged
Conversation
kevinm6
added a commit
to kevinm6/kan
that referenced
this pull request
Sep 4, 2026
kevinm6
added a commit
to kevinm6/kan
that referenced
this pull request
Sep 4, 2026
This was referenced Sep 4, 2026
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.
Description
Card member IDs were resolved globally in the create and add/remove paths. A
caller with permission to edit a card could therefore supply a membership ID
from another workspace.
This change derives the workspace from the target card or list and uses it for
all member lookups. Card creation validates the complete member set before
writing the card, so a mixed valid/foreign request fails atomically. Card
duplication applies the same boundary as defense in depth for legacy or
otherwise inconsistent relationships. Soft-deleted memberships are excluded
from these assignment lookups as well.
The behavior is covered for card creation, add/remove and duplication.
Type of change
Checklist
Testing
pnpm --filter @kan/api test -- card-members.test.tspnpm --filter @kan/db typecheckpnpm --filter @kan/api exec tsc --noEmit --jsx preserveLinked issue
Refs #416. This intentionally addresses only the card-member assignment part
of that report, so it does not close the broader issue.
The same workspace-boundary class was previously addressed for member and
permission endpoints in #410 / #413.