Skip to content

feat(admin): list a user's roles and groups (0.4.2)#59

Merged
jlc488 merged 1 commit into
mainfrom
feat/user-roles-groups-endpoints
Jun 3, 2026
Merged

feat(admin): list a user's roles and groups (0.4.2)#59
jlc488 merged 1 commit into
mainfrom
feat/user-roles-groups-endpoints

Conversation

@jlc488

@jlc488 jlc488 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The admin API could assign/revoke a user's roles (on the role resource) and group membership (on the group resource), but there was no way to read what a user already has — so the admin console couldn't manage a user's access from the user side. Adds:

  • GET /admin/api/v1/users/{id}/roles[{ "value": "<roleId>" }]
  • GET /admin/api/v1/users/{id}/groups[{ "value": "<groupId>" }]

Backed by existing UserRoleService.findRoleIdsForUser / GroupMembershipService.findGroupsForUser (thin delegations, injected into UserAdminController). Assign/revoke continue to live on /roles/{roleId}/users/{userId} and /groups/{groupId}/members/{userId}.

Verification

AdminRbacEnforcementTests calls both new endpoints as the seeded admin (200 + JSON array). Full suite green: 55 tests, 0 failures / 0 errors (./gradlew build, Testcontainers). Docs/CHANGELOG + install coordinates → 0.4.2.

Pairs with admin-ui (Users page gains role/group management dialogs). After release, a consumer (e.g. bookrecord) bumps to 0.4.2 to expose the endpoints.


요약 (한국어)

사용자에게 역할/그룹을 부여·회수하는 API는 있었지만 그 사용자가 이미 무엇을 가졌는지 읽을 방법이 없어서, admin 콘솔이 사용자 화면에서 접근권한을 관리할 수 없었습니다. 추가:

  • GET /users/{id}/roles, GET /users/{id}/groups ([{value}] 배열)

기존 findRoleIdsForUser/findGroupsForUser 위임. 부여/회수는 기존 역할·그룹 리소스에 존재.

검증: AdminRbacEnforcementTests가 두 엔드포인트 호출(200+배열). 전체 그린 55 tests, 0/0. 문서/CHANGELOG + 좌표 0.4.2.

Adds GET /admin/api/v1/users/{id}/roles and /users/{id}/groups (returning
[{value}] id arrays, backed by UserRoleService.findRoleIdsForUser /
GroupMembershipService.findGroupsForUser) so the admin console can manage a
user's access from the user side. Assign/revoke already exist on the role and
group resources.

Test: AdminRbacEnforcementTests hits both new endpoints (200 + JSON array).
Full suite green: 55 tests, 0 failures/0 errors. Docs/CHANGELOG + install
coordinates bumped to 0.4.2.
@jlc488 jlc488 merged commit d1e0eba into main Jun 3, 2026
2 checks passed
@jlc488 jlc488 deleted the feat/user-roles-groups-endpoints branch June 3, 2026 11:10
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