Skip to content

Add team get to resolve a member's roles by name, email, or id - #29

Merged
jbedient-kizen merged 1 commit into
mainfrom
feat/team-member-role-lookup
Sep 4, 2026
Merged

Add team get to resolve a member's roles by name, email, or id#29
jbedient-kizen merged 1 commit into
mainfrom
feat/team-member-role-lookup

Conversation

@jbedient-kizen

Copy link
Copy Markdown
Contributor

Problem

person -> role -> group -> control is the chain you walk to answer "why can this person see that?", and the CLI could not take the first step. The only team-member lookup, team search, goes through /api/team/typeahead, which carries no role field at all — so answering "which role does this person have" meant reading it out of the Kizen UI by hand.

Solution

kizen team get <id|name|email> resolves a team member and names their roles.

Resolution accepts a UUID directly, or a case-insensitive name/email match against team search, falling back to the single result when nothing matches exactly. Roles are named by cross-referencing GET /api/team/{id} against GET /api/role — the retrieve endpoint returns bare role UUIDs rather than expanded objects, confirmed live.

team search's existing output is unchanged.

Testing

bin/check.sh — all five steps pass: 1442 passed, 4 skipped (+12).

The live drift tier was run against a disposable environment with this branch in the stack — identical results to main.

Design notes / tradeoffs

The name/email resolver is now shared with the webhook sample tool, which carried its own near-identical copy. Both call tools.team.team_member_candidates; the extracted default (limit=25) matches what the API layer already used, so neither caller changes behaviour.

The "fall back to the single result" rule is worth pushing on: it makes team get "jo" work when exactly one person matches, but means a typo that happens to match one person resolves silently rather than erroring. The alternative — exact-or-nothing — was rejected as too strict for a lookup command, but it is a judgement call.

Fourth of six stacked branches.

team search goes through /api/team/typeahead, which carries no role
field, so answering "which role does this person have" meant reading it
out of the UI by hand. team get resolves a member by UUID, or by a
case-insensitive name/email match, and names their roles by
cross-referencing /api/team/{id} against /api/role — the retrieve
endpoint returns bare role UUIDs rather than expanded objects.

The name/email resolver is shared with the webhook sample tool's
lookup, which previously carried its own copy.
@jbedient-kizen
jbedient-kizen changed the base branch from feat/init-banner to main September 4, 2026 16:37
@jbedient-kizen
jbedient-kizen merged commit c11e535 into main Sep 4, 2026
4 checks passed
@jbedient-kizen
jbedient-kizen deleted the feat/team-member-role-lookup branch September 4, 2026 16:40
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.

2 participants