Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/appWorkflow/AppWorkflowService.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ func (impl AppWorkflowServiceImpl) FindAppWorkflowsByEnvironmentId(request resou
}
appResults, envResults := request.CheckAuthBatch(token, appObjectArr, envObjectArr)
for _, pipeline := range pipelines {
if _, ok := objects[pipeline.Id]; !ok {
impl.Logger.Warnw("pipeline not found in objects map", "pipelineId", pipeline.Id)
continue
}
appObject := objects[pipeline.Id][0]
envObject := objects[pipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/bulkAction/service/BulkUpdateService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,13 @@ func (impl BulkUpdateServiceImpl) BulkDeploy(request *bean4.BulkApplicationForEn
pResponse[pipelineKey] = false
response[appKey] = pResponse
}
if _, ok := objects[pipeline.Id]; !ok {
//if user unauthorized, skip items
pipelineResponse := response[appKey]
pipelineResponse[pipelineKey] = false
response[appKey] = pipelineResponse
continue
}
appObject := objects[pipeline.Id][0]
envObject := objects[pipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down
8 changes: 8 additions & 0 deletions pkg/pipeline/CdHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,10 @@ func (impl *CdHandlerImpl) FetchAppWorkflowStatusForTriggerViewForEnvironment(re
// filter out pipelines for unauthorized apps but not envs
appResults, _ := request.CheckAuthBatch(token, appObjectArr, envObjectArr)
for _, pipeline := range pipelines {
if _, ok := objects[pipeline.Id]; !ok {
impl.Logger.Warnw("skipping pipeline as no object found for it", "pipelineId", pipeline.Id)
continue
}
appObject := objects[pipeline.Id][0]
if !(appResults[appObject]) {
// if user unauthorized, skip items
Expand Down Expand Up @@ -877,6 +881,10 @@ func (impl *CdHandlerImpl) FetchAppDeploymentStatusForEnvironments(request resou
}
appResults, envResults := request.CheckAuthBatch(token, appObjectArr, envObjectArr)
for _, pipeline := range cdPipelines {
if _, ok := objects[pipeline.Id]; !ok {
impl.Logger.Warnw("skipping pipeline as no object found for it", "pipelineId", pipeline.Id)
continue
}
appObject := objects[pipeline.Id][0]
envObject := objects[pipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down
8 changes: 8 additions & 0 deletions pkg/pipeline/DeploymentPipelineConfigService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,10 @@ func (impl *CdPipelineConfigServiceImpl) GetCdPipelinesByEnvironmentMin(request
//authorization block ends here
span.End()
for _, dbPipeline := range pipelines {
if _, ok := objects[dbPipeline.Id]; !ok {
impl.logger.Warnw("no objects found for pipeline", "pipelineId", dbPipeline.Id)
continue
}
appObject := objects[dbPipeline.Id][0]
envObject := objects[dbPipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down Expand Up @@ -2133,6 +2137,10 @@ func (impl *CdPipelineConfigServiceImpl) GetEnvironmentListForAutocompleteFilter

pipelinesMap := make(map[int][]*pipelineConfig.Pipeline)
for _, pipeline := range cdPipelines {
if _, ok := objects[pipeline.Id]; !ok {
impl.logger.Warnw("skipping pipeline as no object found for it", "pipelineId", pipeline.Id)
continue
}
appObject := objects[pipeline.Id][0]
envObject := objects[pipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/pipeline/DevtronAppConfigService.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ func (impl *DevtronAppConfigServiceImpl) GetAppListForEnvironment(request resour
}
appResults, envResults := request.CheckAuthBatch(token, appObjectArr, envObjectArr)
for _, pipeline := range cdPipelines {
if _, ok := objects[pipeline.Id]; !ok {
impl.logger.Warnw("skipping pipeline as no app and env object found", "pipelineId", pipeline.Id)
continue
}
appObject := objects[pipeline.Id][0]
envObject := objects[pipeline.Id][1]
if !(appResults[appObject] && envResults[envObject]) {
Expand Down