fix: member-created services shouldn't be applied to admin resources (#1113)

This commit is contained in:
UUBulb
2025-08-28 22:37:44 +08:00
committed by GitHub
parent 61b8411d06
commit b6fed87d61
8 changed files with 27 additions and 21 deletions

View File

@@ -223,7 +223,7 @@ func adminHandler[T any](handler handlerFunc[T]) func(*gin.Context) {
}
user := *auth.(*model.User)
if user.Role != model.RoleAdmin {
if !user.Role.IsAdmin() {
c.JSON(http.StatusOK, newErrorResponse(singleton.Localizer.ErrorT("permission denied")))
return
}