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

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

No files matched your search

+1 -1
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
}