use of com.google.gerrit.server.project.LabelResource in project gerrit by GerritCodeReview.
the class LabelsCollection method parse.
@Override
public LabelResource parse(ProjectResource parent, IdString id) throws AuthException, ResourceNotFoundException, PermissionBackendException {
if (!user.get().isIdentifiedUser()) {
throw new AuthException("Authentication required");
}
permissionBackend.currentUser().project(parent.getNameKey()).check(ProjectPermission.READ_CONFIG);
LabelType labelType = parent.getProjectState().getConfig().getLabelSections().get(id.get());
if (labelType == null) {
throw new ResourceNotFoundException(id);
}
return new LabelResource(parent, labelType);
}
Aggregations