public Set<String> keepAuthorizedLoginsOnProject(DbSession dbSession, Set<String> logins, String projectKey, String permission) { return executeLargeInputsIntoSet( logins, partitionOfLogins -> mapper(dbSession).keepAuthorizedLoginsOnProject(partitionOfLogins, projectKey, permission), partitionSize -> partitionSize / 3); }
/** * Used by Governance */ public Set<String> selectViewKeysWithEnabledCopyOfProject(DbSession session, Set<String> projectUuids) { return executeLargeInputsIntoSet(projectUuids, partition -> mapper(session).selectViewKeysWithEnabledCopyOfProject(partition), i -> i); }
/** * @deprecated replaced by {@link #keepAuthorizedProjectUuids(DbSession, Collection, Integer, String)} */ @Deprecated public Set<Long> keepAuthorizedProjectIds(DbSession dbSession, Collection<Long> componentIds, @Nullable Integer userId, String permission) { return executeLargeInputsIntoSet( componentIds, partition -> { if (userId == null) { return mapper(dbSession).keepAuthorizedProjectIdsForAnonymous(permission, partition); } return mapper(dbSession).keepAuthorizedProjectIdsForUser(userId, permission, partition); }, partitionSize -> partitionSize / 2); }
public Set<String> keepAuthorizedProjectUuids(DbSession dbSession, Collection<String> projectUuids, @Nullable Integer userId, String permission) { return executeLargeInputsIntoSet( projectUuids, partition -> { if (userId == null) { return mapper(dbSession).keepAuthorizedProjectUuidsForAnonymous(permission, partition); } return mapper(dbSession).keepAuthorizedProjectUuidsForUser(userId, permission, partition); }, partitionSize -> partitionSize / 2); }
public Set<Long> keepAuthorizedProjectIds(DbSession dbSession, Collection<Long> componentIds, @Nullable Integer userId, String role) { return executeLargeInputsIntoSet( componentIds, partition -> { if (userId == null) { return mapper(dbSession).keepAuthorizedProjectIdsForAnonymous(role, componentIds); } return mapper(dbSession).keepAuthorizedProjectIdsForUser(userId, role, componentIds); }); }