use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ImplicitMergeCheckIT method setRejectImplicitMerges.
private void setRejectImplicitMerges() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
cfg.getProject().setRejectImplicitMerges(InheritableBoolean.TRUE);
saveProjectConfig(project, cfg);
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ConfigChangeIT method setUp.
@Before
public void setUp() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(project).getConfig();
Util.allow(cfg, Permission.OWNER, REGISTERED_USERS, "refs/*");
Util.allow(cfg, Permission.PUSH, REGISTERED_USERS, "refs/for/refs/meta/config");
Util.allow(cfg, Permission.SUBMIT, REGISTERED_USERS, RefNames.REFS_CONFIG);
saveProjectConfig(project, cfg);
setApiUser(user);
fetchRefsMetaConfig();
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ChangeOwnerIT method grantApproveToChangeOwner.
private void grantApproveToChangeOwner() throws Exception {
try (MetaDataUpdate md = metaDataUpdateFactory.create(project)) {
md.setMessage(String.format("Grant approve to change owner"));
ProjectConfig config = ProjectConfig.read(md);
AccessSection s = config.getAccessSection("refs/heads/*", true);
Permission p = s.getPermission(LABEL + "Code-Review", true);
PermissionRule rule = new PermissionRule(config.resolve(systemGroupBackend.getGroup(SystemGroupBackend.CHANGE_OWNER)));
rule.setMin(-2);
rule.setMax(+2);
p.add(rule);
config.commit(md);
projectCache.evict(config.getProject());
}
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class ChangeRebuilderIT method removeRunAs.
private void removeRunAs() throws Exception {
ProjectConfig cfg = projectCache.checkedGet(allProjects).getConfig();
Util.remove(cfg, GlobalCapability.RUN_AS, systemGroupBackend.getGroup(REGISTERED_USERS).getUUID());
saveProjectConfig(allProjects, cfg);
}
use of com.google.gerrit.server.git.ProjectConfig in project gerrit by GerritCodeReview.
the class CommentAddedEventIT 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(pLabel.getName()), 0, 1, anonymousUsers, "refs/heads/*");
saveProjectConfig(project, cfg);
eventListenerRegistration = source.add(new CommentAddedListener() {
@Override
public void onCommentAdded(Event event) {
lastCommentAddedEvent = event;
}
});
}
Aggregations