use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ImpersonationIT method removeRunAs.
private void removeRunAs() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(allProjects).getConfig();
Util.remove(cfg, GlobalCapability.RUN_AS, systemGroupBackend.getGroup(ANONYMOUS_USERS).getUUID());
saveProjectConfig(allProjects, cfg);
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class AbstractSubmitByRebase method submitWithRebaseWithoutAddPatchSetPermission.
@Test
@TestProjectInput(useContentMerge = InheritableBoolean.TRUE)
public void submitWithRebaseWithoutAddPatchSetPermission() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
Util.block(cfg, Permission.ADD_PATCH_SET, REGISTERED_USERS, "refs/*");
Util.allow(cfg, Permission.SUBMIT, REGISTERED_USERS, "refs/heads/*");
Util.allow(cfg, Permission.forLabel(Util.codeReview().getName()), -2, 2, REGISTERED_USERS, "refs/heads/*");
saveProjectConfig(project, cfg);
submitWithRebase(user);
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ImpersonationIT method allowSubmitOnBehalfOf.
private void allowSubmitOnBehalfOf() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
String heads = "refs/heads/*";
AccountGroup.UUID uuid = systemGroupBackend.getGroup(REGISTERED_USERS).getUUID();
Util.allow(cfg, Permission.SUBMIT_AS, uuid, heads);
Util.allow(cfg, Permission.SUBMIT, uuid, heads);
LabelType codeReviewType = Util.codeReview();
Util.allow(cfg, Permission.forLabel(codeReviewType.getName()), -2, 2, uuid, heads);
saveProjectConfig(project, cfg);
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class CustomLabelIT method setUp.
@Before
public void setUp() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
AccountGroup.UUID anonymousUsers = systemGroupBackend.getGroup(ANONYMOUS_USERS).getUUID();
Util.allow(cfg, Permission.forLabel(label.getName()), -1, 1, anonymousUsers, "refs/heads/*");
Util.allow(cfg, Permission.forLabel(P.getName()), 0, 1, anonymousUsers, "refs/heads/*");
saveProjectConfig(project, cfg);
eventListenerRegistration = source.add(new CommentAddedListener() {
@Override
public void onCommentAdded(Event event) {
lastCommentAddedEvent = event;
}
});
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class CustomLabelIT method saveLabelConfig.
private void saveLabelConfig() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
cfg.getLabelSections().put(label.getName(), label);
cfg.getLabelSections().put(P.getName(), P);
saveProjectConfig(project, cfg);
}
Aggregations