From 6c505f9e86424aeb8bf2544517af1141d2853a55 Mon Sep 17 00:00:00 2001 From: Ahsan Barkati Date: Wed, 4 May 2022 21:45:20 +0530 Subject: [PATCH] Fix error message (#1080) --- pkg/query-service/app/http_handler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go index f2edf14e6f..a3023ef92c 100644 --- a/pkg/query-service/app/http_handler.go +++ b/pkg/query-service/app/http_handler.go @@ -205,7 +205,7 @@ func ViewAccess(f func(http.ResponseWriter, *http.Request)) http.HandlerFunc { if !(auth.IsViewer(user) || auth.IsEditor(user) || auth.IsAdmin(user)) { respondError(w, &model.ApiError{ Typ: model.ErrorForbidden, - Err: errors.New("API is not accessible to the viewers."), + Err: errors.New("API is accessible to viewers/editors/admins."), }, nil) return } @@ -226,7 +226,7 @@ func EditAccess(f func(http.ResponseWriter, *http.Request)) http.HandlerFunc { if !(auth.IsEditor(user) || auth.IsAdmin(user)) { respondError(w, &model.ApiError{ Typ: model.ErrorForbidden, - Err: errors.New("API is not accessible to the editors."), + Err: errors.New("API is accessible to editors/admins."), }, nil) return } @@ -248,7 +248,7 @@ func SelfAccess(f func(http.ResponseWriter, *http.Request)) http.HandlerFunc { if !(auth.IsSelfAccessRequest(user, id) || auth.IsAdmin(user)) { respondError(w, &model.ApiError{ Typ: model.ErrorForbidden, - Err: errors.New("API accessible only for self userId or admins."), + Err: errors.New("API is accessible for self access or to the admins."), }, nil) return } @@ -269,7 +269,7 @@ func AdminAccess(f func(http.ResponseWriter, *http.Request)) http.HandlerFunc { if !auth.IsAdmin(user) { respondError(w, &model.ApiError{ Typ: model.ErrorForbidden, - Err: errors.New("API accessible only to the admins"), + Err: errors.New("API is accessible to admins only"), }, nil) return }