Move ChangeControl#getLabelTypes() to ProjectState and migrate callers

In an effort to make {Ref,Project,Change}Control package-private all
public methods that aren't replaced by PermissionBackend need to move
elsewhere. Both ProjectControl#getLabelTypes() and
ChangeControl#getLabelTypes() rely on the project state, so they
can move there. ChangeControl#getLabelTypes() needs the destination
branch and current user in addition, which are added as arguments.

Change-Id: I080fd93103679552952872dde49cc149a59cd43e
This commit is contained in:
Patrick Hiesel
2017-08-30 10:12:37 +02:00
parent 31862df733
commit ed5ce1722f
17 changed files with 194 additions and 122 deletions

View File

@@ -221,7 +221,7 @@ class ProjectAccessFactory extends Handler<ProjectAccess> {
|| (checkReadConfig && perm.ref(RefNames.REFS_CONFIG).testOrFalse(CREATE_CHANGE)));
detail.setConfigVisible(pc.isOwner() || checkReadConfig);
detail.setGroupInfo(buildGroupInfo(local));
detail.setLabelTypes(pc.getLabelTypes());
detail.setLabelTypes(pc.getProjectState().getLabelTypes());
detail.setFileHistoryLinks(getConfigFileLogLinks(projectName.get()));
return detail;
}