From 53f529cfad7ddd4689132e32f13e9d9a3e6fed75 Mon Sep 17 00:00:00 2001 From: Mohamad Choupan Date: Mon, 28 Oct 2024 18:38:07 +0330 Subject: [PATCH] feat: change status of role check --- pkg/httpserver/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/httpserver/auth.go b/pkg/httpserver/auth.go index 1ac9318..3b9a767 100644 --- a/pkg/httpserver/auth.go +++ b/pkg/httpserver/auth.go @@ -29,7 +29,7 @@ func RequireMinRole(ctx echo.Context, minRole api.Role) error { if !hasAccess(GetUserRole(ctx), minRole) { userRole := GetUserRole(ctx) fmt.Println("required role = ", minRole, " user role = ", userRole) - return echo.NewHTTPError(http.StatusForbidden, "missing required permission") + return echo.NewHTTPError(http.StatusNotAcceptable, "missing required permission") } return nil @@ -69,7 +69,7 @@ func CheckAccessToConnectionID(ctx echo.Context, connectionID string) error { return nil } } - return echo.NewHTTPError(http.StatusForbidden, "Invalid connection ID") + return echo.NewHTTPError(http.StatusNotAcceptable, "Invalid connection ID") } func ResolveConnectionIDs(ctx echo.Context, connectionIDs []string) ([]string, error) {