diff options
author | Léo Geoffroy <leo.geoffroy@sonarsource.com> | 2023-05-11 10:33:45 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-05-11 20:03:13 +0000 |
commit | 9bae806d9195bbd5c63063dd64dcb855d8fb364e (patch) | |
tree | 0abd1c8c10d4be02790320174bc72621bcc3ecdc /server/sonar-webserver-es/src/testFixtures | |
parent | cc1d563b233d7099b2430e247e44c25b53fa8a74 (diff) | |
download | sonarqube-9bae806d9195bbd5c63063dd64dcb855d8fb364e.tar.gz sonarqube-9bae806d9195bbd5c63063dd64dcb855d8fb364e.zip |
SONAR-18856 Fix Delete/List branch endpoint to support project uuid
Diffstat (limited to 'server/sonar-webserver-es/src/testFixtures')
-rw-r--r-- | server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java index fa02817876f..59d6417564f 100644 --- a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java +++ b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/PermissionIndexerTester.java @@ -22,6 +22,7 @@ package org.sonar.server.permission.index; import java.util.List; import java.util.stream.Stream; import org.sonar.db.component.ComponentDto; +import org.sonar.db.project.ProjectDto; import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; import org.sonar.server.es.EsTester; @@ -41,6 +42,10 @@ public class PermissionIndexerTester { return allow(stream(projects).map(project -> new IndexPermissions(project.uuid(), project.qualifier()).allowAnyone()).toList()); } + public PermissionIndexerTester allowOnlyAnyone(ProjectDto... projects) { + return allow(stream(projects).map(project -> new IndexPermissions(project.getUuid(), project.getQualifier()).allowAnyone()).toList()); + } + public PermissionIndexerTester allowOnlyUser(ComponentDto project, UserDto user) { IndexPermissions dto = new IndexPermissions(project.uuid(), project.qualifier()) .addUserUuid(user.getUuid()); |