Skip to content

Commit

Permalink
feat:流水线列表展示权限控制 #10895
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Oct 29, 2024
1 parent 9b51322 commit 32e4349
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ class PipelineListFacadeService @Autowired constructor(
userId = userId, projectId = projectId, permission = AuthPermission.LIST
)
val isControlPipelineListPermission = pipelinePermissionService.isControlPipelineListPermission(projectId)
val permissionFlag = if (isControlPipelineListPermission) true else null
val favorPipelines = pipelineGroupService.getFavorPipelines(userId = userId, projectId = projectId)
val recentUsePipelines = pipelineRecentUseService.listPipelineIds(userId, projectId)
val totalCount = pipelineBuildSummaryDao.listPipelineInfoBuildSummaryCount(
Expand All @@ -968,7 +969,7 @@ class PipelineListFacadeService @Autowired constructor(
viewId = PIPELINE_VIEW_ALL_PIPELINES,
includeDelete = false,
userId = userId,
permissionFlag = true
permissionFlag = permissionFlag
).toInt()
val myFavoriteCount = pipelineBuildSummaryDao.listPipelineInfoBuildSummaryCount(
dslContext = dslContext,
Expand All @@ -979,7 +980,7 @@ class PipelineListFacadeService @Autowired constructor(
viewId = PIPELINE_VIEW_FAVORITE_PIPELINES,
includeDelete = false,
userId = userId,
permissionFlag = isControlPipelineListPermission
permissionFlag = permissionFlag
).toInt()
val myPipelineCount = pipelineBuildSummaryDao.listPipelineInfoBuildSummaryCount(
dslContext = dslContext,
Expand All @@ -990,7 +991,7 @@ class PipelineListFacadeService @Autowired constructor(
viewId = PIPELINE_VIEW_MY_PIPELINES,
includeDelete = false,
userId = userId,
permissionFlag = isControlPipelineListPermission
permissionFlag = permissionFlag
).toInt()
val recentUseCount = pipelineBuildSummaryDao.listPipelineInfoBuildSummaryCount(
dslContext = dslContext,
Expand All @@ -1002,7 +1003,7 @@ class PipelineListFacadeService @Autowired constructor(
includeDelete = false,
userId = userId,
pipelineIds = recentUsePipelines,
permissionFlag = isControlPipelineListPermission
permissionFlag = permissionFlag
).toInt()
val recycleCount = pipelineInfoDao.countPipeline(
dslContext = dslContext,
Expand Down

0 comments on commit 32e4349

Please sign in to comment.