From 407328f9ede8efb57c80f520d6539599632a87db Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 27 May 2019 09:15:50 +1200 Subject: [PATCH] fix(api): remove admin restriction for registry proxy endpoint --- api/http/handler/registries/proxy.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/api/http/handler/registries/proxy.go b/api/http/handler/registries/proxy.go index 1da1ed88d..d54520508 100644 --- a/api/http/handler/registries/proxy.go +++ b/api/http/handler/registries/proxy.go @@ -5,8 +5,6 @@ import ( "net/http" "strconv" - "github.com/portainer/portainer/api/http/security" - httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/portainer/api" @@ -26,15 +24,6 @@ func (handler *Handler) proxyRequestsToRegistryAPI(w http.ResponseWriter, r *htt return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find a registry with the specified identifier inside the database", err} } - securityContext, err := security.RetrieveRestrictedRequestContext(r) - if err != nil { - return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve info from request context", err} - } - - if !securityContext.IsAdmin { - return &httperror.HandlerError{http.StatusForbidden, "Access denied to resource", portainer.ErrResourceAccessDenied} - } - err = handler.requestBouncer.RegistryAccess(r, registry) if err != nil { return &httperror.HandlerError{http.StatusForbidden, "Permission denied to access registry", portainer.ErrEndpointAccessDenied}