throws ServiceNotAuthorizedException {
final ProjectControl pc = (ProjectControl) req.getAttribute(ATT_CONTROL);
if (!(pc.getCurrentUser() instanceof IdentifiedUser)) {
// Anonymous users are not permitted to push.
throw new ServiceNotAuthorizedException();
}
final IdentifiedUser user = (IdentifiedUser) pc.getCurrentUser();
final ReceiveCommits rc = factory.create(pc, db).getReceiveCommits();
rc.getReceivePack().setRefLogIdent(user.newRefLogIdent());