feat(app/sources): UAC on sources (#2881)

Co-authored-by: Chaim Lev-Ari <chaim.lev-ari@portainer.io>
Co-authored-by: andres-portainer <91705312+andres-portainer@users.noreply.github.com>
This commit is contained in:
LP B
2026-06-23 16:30:31 +02:00
committed by GitHub
parent e664bf0e19
commit 56c0ddac85
116 changed files with 2637 additions and 945 deletions
@@ -6,6 +6,7 @@ import (
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
"github.com/portainer/portainer/api/dataservices/source"
httperrors "github.com/portainer/portainer/api/http/errors"
"github.com/portainer/portainer/api/http/security"
"github.com/portainer/portainer/api/internal/authorization"
@@ -70,7 +71,8 @@ func (handler *Handler) customTemplateInspect(w http.ResponseWriter, r *http.Req
return httperror.Forbidden("Access denied to resource", httperrors.ErrResourceAccessDenied)
}
populateGitConfig(tx, customTemplate)
userContext := source.NewUserContext(securityContext.User, securityContext.UserMemberships)
populateGitConfig(tx, userContext, customTemplate)
return nil
})