Skip to content

Commit

Permalink
Merge pull request #135 from opengovern/feat-status-codes
Browse files Browse the repository at this point in the history
feat: change status of role check
  • Loading branch information
mohamadch91 authored Oct 28, 2024
2 parents 668e969 + 53f529c commit 3f20bde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/httpserver/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3f20bde

Please sign in to comment.