feat(settings): hide stacks for non admin when settings is set (#4025)

* refactor(settings): replace disableDeviceMapping with allow

* feat(dashboard): hide stacks if settings disabled and non admin

* refactor(sidebar): check if user is endpoint admin

* feat(settings): set the default value for stack management

* feat(settings): rename field label

* fix(sidebar): refresh show stacks state
This commit is contained in:
Chaim Lev-Ari
2020-07-13 09:36:47 +03:00
committed by GitHub
parent 5ebb03cb4e
commit cd58c16b4e
16 changed files with 128 additions and 84 deletions

View File

@@ -48,7 +48,7 @@ func (handler *Handler) stackCreate(w http.ResponseWriter, r *http.Request) *htt
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve settings from the database", err}
}
if settings.DisableStackManagementForRegularUsers {
if !settings.AllowStackManagementForRegularUsers {
securityContext, err := security.RetrieveRestrictedRequestContext(r)
if err != nil {
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve user info from request context", err}