diff --git a/api/http/handler/templates/handler.go b/api/http/handler/templates/handler.go index 5c89f350f..0bcb411f7 100644 --- a/api/http/handler/templates/handler.go +++ b/api/http/handler/templates/handler.go @@ -24,8 +24,8 @@ func NewHandler(bouncer *security.RequestBouncer) *Handler { } h.Handle("/templates", - bouncer.RestrictedAccess(httperror.LoggerHandler(h.templateList))).Methods(http.MethodGet) + bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.templateList))).Methods(http.MethodGet) h.Handle("/templates/file", - bouncer.RestrictedAccess(httperror.LoggerHandler(h.templateFile))).Methods(http.MethodPost) + bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.templateFile))).Methods(http.MethodPost) return h } diff --git a/api/http/security/rbac.go b/api/http/security/rbac.go index c6c4211af..bdc17ca39 100644 --- a/api/http/security/rbac.go +++ b/api/http/security/rbac.go @@ -542,6 +542,9 @@ func portainerTemplatesOperationAuthorization(url, method string) portainer.Auth if resource == "" && action == "" { return portainer.OperationPortainerTemplateCreate } + if resource == "file" && action == "" { + return portainer.OperationPortainerTemplateInspect + } case http.MethodPut: if resource != "" && action == "" { return portainer.OperationPortainerTemplateUpdate diff --git a/app/docker/components/dockerSidebarContent/dockerSidebarContent.html b/app/docker/components/dockerSidebarContent/dockerSidebarContent.html index 5af425761..f97ff4491 100644 --- a/app/docker/components/dockerSidebarContent/dockerSidebarContent.html +++ b/app/docker/components/dockerSidebarContent/dockerSidebarContent.html @@ -1,7 +1,7 @@