Skip to content

Commit 470dc3c

Browse files
fix: enable api for all users for module (#3495)
* enable api for all users * fix for query break
1 parent 0e1ea87 commit 470dc3c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

internal/sql/repository/security/ImageScanResultRepository.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,30 +94,30 @@ func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId
9494
Where("image_scan_execution_result.scan_execution_id = ?", id).Select()
9595
*/
9696

97-
err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "CveStore").
97+
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "CveStore").
9898
Where("image_scan_execution_result.image_scan_execution_history_id = ?", scanExecutionId).
9999
Select()
100100
return models, err
101101
}
102102

103103
func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionIds(ids []int) ([]*ImageScanExecutionResult, error) {
104104
var models []*ImageScanExecutionResult
105-
err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
105+
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
106106
Where("image_scan_execution_result.image_scan_execution_history_id in(?)", pg.In(ids)).
107107
Select()
108108
return models, err
109109
}
110110

111111
func (impl ImageScanResultRepositoryImpl) FindByImageDigest(imageDigest string) ([]*ImageScanExecutionResult, error) {
112112
var model []*ImageScanExecutionResult
113-
err := impl.dbConnection.Model(&model).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
113+
err := impl.dbConnection.Model(&model).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
114114
Where("image_scan_execution_history.image_hash = ?", imageDigest).Order("image_scan_execution_history.execution_time desc").Select()
115115
return model, err
116116
}
117117

118118
func (impl ImageScanResultRepositoryImpl) FindByImageDigests(digest []string) ([]*ImageScanExecutionResult, error) {
119119
var models []*ImageScanExecutionResult
120-
err := impl.dbConnection.Model(&models).ColumnExpr("DISTINCT cve_store_name").Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
120+
err := impl.dbConnection.Model(&models).Column("image_scan_execution_result.*", "ImageScanExecutionHistory", "CveStore").
121121
Where("image_hash in (?)", pg.In(digest)).Order("execution_time desc").Select()
122122
return models, err
123123
}

pkg/module/ModuleService.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,6 @@ func (impl ModuleServiceImpl) HandleModuleAction(userId int32, moduleName string
435435
}, nil
436436
}
437437
func (impl ModuleServiceImpl) EnableModule(moduleName, version string) (*ActionResponse, error) {
438-
if impl.serverEnvConfig.DevtronInstallationType != serverBean.DevtronInstallationTypeOssHelm {
439-
return nil, errors.New("module Enabling is not allowed")
440-
}
441438

442439
// get module by name
443440
module, err := impl.moduleRepository.FindOne(moduleName)

0 commit comments

Comments
 (0)