Source:
<code>public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { parseCommandLine(); Project.NameKey parentProject = null; if (newParent != null) { parentProject = newParent.getProject().getNameKey(); } <START> if (!currentUser.getCapabilityByProject(parentProject).canCreateProject()) { <END> String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } validateParameters(); try { nameKey = new Project.NameKey(projectName); String head = permissionsOnly ? GitRepositoryManager.REF_CONFIG : branch; final Repository repo = repoManager.createRepository(nameKey); try { rq.replicateNewProject(nameKey, head); RefUpdate u = repo.updateRef(Constants.HEAD); u.disableRefLog(); u.link(head); createProjectConfig(); if (!permissionsOnly && createEmptyCommit) { createEmptyCommit(repo, nameKey, branch); } } finally { repo.close(); } } catch (IllegalStateException err) { try { Repository repo = repoManager.openRepository(nameKey); try { if (repo.getObjectDatabase().exists()) { throw new UnloggedFailure(1, "fatal: project \"" + projectName + "\" exists"); } } finally { repo.close(); } } catch (RepositoryNotFoundException doesNotExist) { throw new Failure(1, "fatal: Cannot create " + projectName, err); } } catch (RepositoryNotFoundException badName) { throw new UnloggedFailure(1, "fatal: " + badName.getMessage()); } catch (Exception err) { throw new Failure(1, "fatal: Cannot create " + projectName, err); } } }); }</code><technical_language>feels this check in a canCreateChildProject() method in projectControl</technical_language>

Target:
public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { parseCommandLine(); if ((newParent != null && !newParent.canCreateChildProject()) || (newParent == null && !currentUser.getCapabilityByProject(null) .canCreateProject())) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } validateParameters(); try { nameKey = new Project.NameKey(projectName); String head = permissionsOnly ? GitRepositoryManager.REF_CONFIG : branch; final Repository repo = repoManager.createRepository(nameKey); try { rq.replicateNewProject(nameKey, head); RefUpdate u = repo.updateRef(Constants.HEAD); u.disableRefLog(); u.link(head); createProjectConfig(); if (!permissionsOnly && createEmptyCommit) { createEmptyCommit(repo, nameKey, branch); } } finally { repo.close(); } } catch (IllegalStateException err) { try { Repository repo = repoManager.openRepository(nameKey); try { if (repo.getObjectDatabase().exists()) { throw new UnloggedFailure(1, "fatal: project \"" + projectName + "\" exists"); } } finally { repo.close(); } } catch (RepositoryNotFoundException doesNotExist) { throw new Failure(1, "fatal: Cannot create " + projectName, err); } } catch (RepositoryNotFoundException badName) { throw new UnloggedFailure(1, "fatal: " + badName.getMessage()); } catch (Exception err) { throw new Failure(1, "fatal: Cannot create " + projectName, err); } } }); }