Skip to content

refactor(auth): introduce permission annotation and super-admin flag - #151

Merged
VLSMB merged 5 commits into
mainfrom
refactor/clean-code
Sep 18, 2026
Merged

VLSMB merged 5 commits into
mainfrom
refactor/clean-code

Conversation

@VLSMB

@VLSMB VLSMB commented Sep 18, 2026

Copy link
Copy Markdown
Member

related #150

…per-admin flag

- Rename @adminonly to @RequirePermission with a PermissionEnum[] placeholder
  (role/business-type authorization tracked in Issue #150)
- Add sys_user.is_super_admin across entity/UserContext/DTO/Mapper/SQL and
  migration_compatibility.sql; UserContext now carries superAdmin
- AuthInterceptor: bypass when no permission annotation, skip checks for the
  super admin, otherwise delegate to checkPermission
- AdminBootstrapRunner: seed initial super admin (role_id=0, is_super_admin=1)
  and use existUser() instead of countAll(); remove RoleBootstrapRunner
- Move selectAuthProjection from SysUserMapper up to SysUserService
- Frontend: show a 'super admin' tag in the user management page
- Chore: ignore *.factorypath, add tracing TODO note in TraceIdFilter
- Validate selectById result in selectAuthProjection and return null when
  status != 1, restoring the previous behavior
- Move the null/401 check in AuthInterceptor ahead of UserContext.set and the
  no-annotation bypass, so disabled/deleted users cannot reach any endpoint
- Refresh docs for @RequirePermission, the super-admin flag, and admin bootstrap
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! We will review your request as soon as possible. Please review the code yourself using ponytail https://github.com/DietrichGebert/ponytail.

@VLSMB
VLSMB merged commit 8d19cf2 into main Sep 18, 2026
4 checks passed
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