Skip to content

Commit

Permalink
Fix ListAction
Browse files Browse the repository at this point in the history
  • Loading branch information
C4tWithShell committed Oct 25, 2023
1 parent c6cd61e commit d674690
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public void handleProjectRequest(ProjectDto project, Request request, Response r
.map(BranchDto::getMergeBranchUuid)
.filter(Objects::nonNull)
.collect(Collectors.toList()))
.stream().collect(MoreCollectors.uniqueIndex(BranchDto::getUuid));
.stream().collect(CommunityMoreCollectors.uniqueIndex(BranchDto::getUuid));

Map<String, LiveMeasureDto> qualityGateMeasuresByComponentUuids = getDbClient().liveMeasureDao()
.selectByComponentUuidsAndMetricKeys(dbSession, pullRequestUuids, List.of(CoreMetrics.ALERT_STATUS_KEY)).stream()
.collect(MoreCollectors.uniqueIndex(LiveMeasureDto::getComponentUuid));
.collect(CommunityMoreCollectors.uniqueIndex(LiveMeasureDto::getComponentUuid));
Map<String, String> analysisDateByBranchUuid = getDbClient().snapshotDao().selectLastAnalysesByRootComponentUuids(dbSession, pullRequestUuids).stream()
.collect(MoreCollectors.uniqueIndex(SnapshotDto::getComponentUuid, s -> DateUtils.formatDateTime(s.getCreatedAt())));
.collect(CommunityMoreCollectors.uniqueIndex(SnapshotDto::getComponentUuid, s -> DateUtils.formatDateTime(s.getCreatedAt())));

ProjectPullRequests.ListWsResponse.Builder protobufResponse = ProjectPullRequests.ListWsResponse.newBuilder();
pullRequests
Expand All @@ -106,8 +106,8 @@ public void handleProjectRequest(ProjectDto project, Request request, Response r
}

private static void checkPermission(ProjectDto project, UserSession userSession) {
if (userSession.hasProjectPermission(UserRole.USER, project) ||
userSession.hasProjectPermission(UserRole.SCAN, project) ||
if (userSession.hasEntityPermission(UserRole.USER, project) ||
userSession.hasEntityPermission(UserRole.SCAN, project) ||
userSession.hasPermission(GlobalPermission.SCAN)) {
return;
}
Expand Down

0 comments on commit d674690

Please sign in to comment.