feat(auth): add user profile centre and admin role system

- add GET/PUT /user/me endpoints for profile viewing and editing
- add PUT /user/me/password endpoint for password changes
- add GET /user/me/builds skeleton endpoint for future CustomModification
- add user_role table with ROLE_USER, ROLE_ADMIN, and ROLE_SUPER_USER roles
- add @RequiresRole annotation with custom AuthorizationManager enforcement
- extend User entity with nickname, avatarUrl, emailVerified, enabled,
  createdAt, and updatedAt columns
- load user roles into SecurityContext authorities via TokenAuthenticationFilter
- add @CurrentUser annotation and argument resolver for controller injection
- add PUT/DELETE /admin/users/{id}/roles for SUPER_USER role management
- add V6 and V7 Flyway migrations for schema changes

Closes #5
Closes #8
This commit is contained in:
zihluwang committed 2026-07-21 13:44:02 +08:00
1 parent 0aeaac17a4
commit db5056e8d5
24 files changed
+1091 -7

No files matched your search

@@ -0,0 +1,6 @@
CREATE TABLE user_role
(
user_id BIGINT NOT NULL REFERENCES app_user (id),
role VARCHAR(32) NOT NULL,
CONSTRAINT user_role_pkey PRIMARY KEY (user_id, role)
);