mirror of https://github.com/portainer/portainer
				
				
				
			fix(stack): allow standard users use advanced deployment (#5205)
							parent
							
								
									5466e68f50
								
							
						
					
					
						commit
						89f53458c6
					
				| 
						 | 
					@ -14,7 +14,6 @@ import (
 | 
				
			||||||
	portainer "github.com/portainer/portainer/api"
 | 
						portainer "github.com/portainer/portainer/api"
 | 
				
			||||||
	bolterrors "github.com/portainer/portainer/api/bolt/errors"
 | 
						bolterrors "github.com/portainer/portainer/api/bolt/errors"
 | 
				
			||||||
	gittypes "github.com/portainer/portainer/api/git/types"
 | 
						gittypes "github.com/portainer/portainer/api/git/types"
 | 
				
			||||||
	httperrors "github.com/portainer/portainer/api/http/errors"
 | 
					 | 
				
			||||||
	"github.com/portainer/portainer/api/http/security"
 | 
						"github.com/portainer/portainer/api/http/security"
 | 
				
			||||||
	"github.com/portainer/portainer/api/internal/authorization"
 | 
						"github.com/portainer/portainer/api/internal/authorization"
 | 
				
			||||||
	"github.com/portainer/portainer/api/internal/endpointutils"
 | 
						"github.com/portainer/portainer/api/internal/endpointutils"
 | 
				
			||||||
| 
						 | 
					@ -113,10 +112,6 @@ func (handler *Handler) stackCreate(w http.ResponseWriter, r *http.Request) *htt
 | 
				
			||||||
	case portainer.DockerComposeStack:
 | 
						case portainer.DockerComposeStack:
 | 
				
			||||||
		return handler.createComposeStack(w, r, method, endpoint, tokenData.ID)
 | 
							return handler.createComposeStack(w, r, method, endpoint, tokenData.ID)
 | 
				
			||||||
	case portainer.KubernetesStack:
 | 
						case portainer.KubernetesStack:
 | 
				
			||||||
		if tokenData.Role != portainer.AdministratorRole {
 | 
					 | 
				
			||||||
			return &httperror.HandlerError{StatusCode: http.StatusForbidden, Message: "Access denied", Err: httperrors.ErrUnauthorized}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		return handler.createKubernetesStack(w, r, method, endpoint)
 | 
							return handler.createKubernetesStack(w, r, method, endpoint)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue