5.5 User Management and RBAC¶
Sprint: Sprint 05 - Security and Identity
Feature ID: 5.5
Subtasks: 5.5.1, 5.5.2
Objective¶
Deliver "User Management and RBAC" within Sprint 05 - Security and Identity.
Dependencies¶
Aggregated from the subtasks below (prerequisite task IDs and enablers):
- 5.2.2
- 5.6.1
- 5.1.2
Subtasks¶
5.5.1 User CRUD and role assignment (admin)¶
- ID: 5.5.1
- Title: Implement user management commands/queries with @PreAuthorize
- Description: Commands/queries for create user, assign roles, get user, list users; admin endpoints
guarded by
@PreAuthorize/mediatorAuthorizationRulerequiring an admin role. Publishuser.created.v1via the outbox. - Business Purpose: Administer accounts and authorization (FR-IAM-04).
- Inputs: FR-IAM-04, service-catalog identity-service.
- Outputs: User commands/queries, controller, authorization rules,
user.created.v1. - Acceptance Criteria:
GET /api/v1/users/{id}returns the user; admin-only endpoints return 403 for non-admin tokens; creating a user emitsuser.created.v1to the outbox.- Dependencies: 5.2.2, 5.6.1
- Complexity: M
5.5.2 Seed roles, permissions, and bootstrap admin¶
- ID: 5.5.2
- Title: Seed default roles/permissions and a bootstrap admin
- Description: Flyway/data seeding for roles (ADMIN, AGENT, DEALER, BILLING_OPERATOR, SUBSCRIBER) and their permissions, plus an initial admin account (credentials from encrypted config).
- Business Purpose: Make RBAC and admin operations usable from first boot; maps the analysis actors.
- Inputs: analysis Section 3 (actors), 4.1.2.
- Outputs: Seed migration/data.
- Acceptance Criteria:
- On a fresh DB, default roles/permissions and one admin exist; the admin can authenticate.
- Dependencies: 5.1.2
- Complexity: S
Acceptance Criteria¶
Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.
Deliverables¶
- User commands/queries, controller, authorization rules,
user.created.v1. - Seed migration/data.
Definition of Done¶
- All subtasks (5.5.1, 5.5.2) completed and their acceptance criteria verified.
- All listed dependencies satisfied.
- Build and tests green per the global conventions in ../README.md (Section 3).