Skip to content

[ai-assisted] feat(user): 관리자 사용자 삭제 API 추가#378

Merged
donghyuck merged 1 commit into2.xfrom
codex/issue-376-user-delete
Apr 29, 2026
Merged

[ai-assisted] feat(user): 관리자 사용자 삭제 API 추가#378
donghyuck merged 1 commit into2.xfrom
codex/issue-376-user-delete

Conversation

@donghyuck
Copy link
Copy Markdown
Owner

@donghyuck donghyuck commented Apr 29, 2026

Why

  • Admin 회원 목록에는 사용자 삭제 액션이 있지만 서버 기본 사용자 관리 API에 DELETE /api/mgmt/users/{id}가 없어 클라이언트에서 삭제 기능을 연결할 수 없었습니다.
  • ApplicationUserService.delete(Long userId)는 이미 존재하므로 기본 관리 컨트롤러에 엔드포인트를 노출합니다.

What

  • UserMgmtControllerDELETE /{id} 엔드포인트를 추가했습니다.
  • 기존 사용자 관리 권한 체계에 맞춰 features:user admin 권한을 적용했습니다.
  • 성공 응답은 삭제 API 관례에 맞춰 204 No Content로 반환합니다.
  • UserMgmtApi에는 default 메서드로 delete 계약을 추가해 커스텀 컨트롤러 구현체의 컴파일 호환성을 유지했습니다.
  • ApplicationUserServiceImpl.delete 성공 시 user id cache와 username cache를 정리하도록 보강했습니다.
  • user/starter README에 삭제 API를 문서화했습니다.

Related Issues

Validation

  • Command: ./gradlew :studio-platform-user:compileJava :studio-platform-user-default:test :starter:studio-platform-starter-user:test
  • Result: 성공
  • Command: ./gradlew test
  • Result: 성공
  • Command: git diff --check
  • Result: 성공

Risk / Rollback

  • Risk: 기본 구현은 기존 ApplicationUserService.delete의 물리 삭제 정책을 그대로 사용합니다. user property, role, group membership은 스키마상 cascade 삭제 대상입니다. 별도 soft-delete 정책이 필요한 경우 후속 정책 이슈로 분리해야 합니다.
  • Rollback: 해당 커밋을 revert하면 기본 사용자 관리 API에서 DELETE 엔드포인트가 제거됩니다.

AI / Subagent Usage

Checklist

  • commit message follows policy
  • issue template used or exception recorded
  • AI-Assisted value is correct
  • validation recorded
  • subagent usage recorded when used
  • CI / repository verification passed
  • human review completed before merge
  • no unrelated changes included

Issue:
- #376

Why:
- Admin 회원 목록에는 사용자 삭제 액션이 있지만 기본 사용자 관리 컨트롤러에 DELETE /api/mgmt/users/{id} 엔드포인트가 없어 클라이언트 연결이 불가능했다.

What:
- 기본 UserMgmtController에 features:user admin 권한의 DELETE /{id} 엔드포인트를 추가했다.
- UserMgmtApi에는 default delete 계약을 추가해 커스텀 구현체 호환성을 유지했다.
- ApplicationUserServiceImpl.delete 성공 시 사용자 캐시를 정리하도록 보강했다.
- user README와 starter README에 삭제 API와 응답 형식을 문서화했다.

Validation:
- ./gradlew :studio-platform-user:compileJava :studio-platform-user-default:test :starter:studio-platform-starter-user:test: 성공
- ./gradlew test: 성공
- git diff --check: 성공
Copy link
Copy Markdown
Owner Author

@donghyuck donghyuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review completed.

확인 결과:

  • PR diff는 이슈 #376 범위의 사용자 관리 삭제 API, 캐시 정리, 테스트, README 변경만 포함합니다.
  • DELETE /api/mgmt/users/{id}는 기존 사용자 관리 admin 권한(features:user/admin)을 사용합니다.
  • UserMgmtApi는 default 메서드로 확장되어 커스텀 컨트롤러 구현체의 컴파일 호환성을 유지합니다.
  • 기본 삭제 정책은 기존 ApplicationUserService.delete 물리 삭제이며, 스키마상 user property/role/group membership은 cascade 삭제됩니다.
  • targeted tests, full ./gradlew test, git diff --check, gitleaks check가 통과했습니다.

추가 수정 필요 사항은 발견하지 못했습니다. soft delete, self-delete 방지, last-admin 보호 같은 운영 정책은 별도 요구사항으로 다루는 편이 맞습니다.

Copy link
Copy Markdown
Owner Author

@donghyuck donghyuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed after re-checking PR #378.

Findings:

  • Blocking issue: none
  • Security/authorization: DELETE /api/mgmt/users/{id} uses the existing features:user/admin guard, consistent with password reset/enable/disable admin APIs.
  • Compatibility: UserMgmtApi.delete is a default method, so existing custom implementations are not forced to implement the new method at compile time.
  • Data behavior: the endpoint exposes the existing ApplicationUserService.delete(Long userId) physical-delete policy; user properties, role mappings, and group memberships are covered by cascade constraints in the user schema.
  • Cache behavior: user id cache and username cache are evicted after successful delete.
  • Tests/checks: targeted tests, full ./gradlew test, git diff --check, and gitleaks all pass.

No additional code changes are required for the current issue scope. If self-delete prevention, last-admin protection, or soft delete is required, it should be handled as an explicit policy issue rather than inferred into this endpoint wiring fix.

@donghyuck donghyuck merged commit 188686d into 2.x Apr 29, 2026
2 checks passed
@donghyuck donghyuck deleted the codex/issue-376-user-delete branch April 29, 2026 12:52
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