use of com.google.gerrit.server.group.CreateGroup in project gerrit by GerritCodeReview.
the class GroupsImpl method create.
@Override
public GroupApi create(GroupInput in) throws RestApiException {
if (checkNotNull(in, "GroupInput").name == null) {
throw new BadRequestException("GroupInput must specify name");
}
try {
CreateGroup impl = createGroup.create(in.name);
permissionBackend.user(user).checkAny(GlobalPermission.fromAnnotation(impl.getClass()));
GroupInfo info = impl.apply(TopLevelResource.INSTANCE, in);
return id(info.id);
} catch (Exception e) {
throw asRestApiException("Cannot create group " + in.name, e);
}
}
Aggregations