commit aeb317db41bfa0651340bff00dd277d6a111774e
parent c712657e9369c1d63beb0824b4bfe8cf06ce1ffa
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 6 Feb 2023 14:38:59 -0800
fix typo in middleware
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/web/middlewares/middlewares.go b/pkg/web/middlewares/middlewares.go
@@ -330,7 +330,7 @@ func IsModeratorMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
if strings.HasPrefix(c.Path(), "/api") {
if user == nil {
return c.NoContent(http.StatusUnauthorized)
- } else if !user.IsAdmin {
+ } else if !user.IsModerator() {
return c.NoContent(http.StatusForbidden)
}
return c.NoContent(http.StatusInternalServerError)