From ec7ac2149ba8603ff1455c948c07037bf6ee030c Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 22 Oct 2012 16:07:14 -0400 Subject: [PATCH] Renamed method to UserModel.canCreate(String repository) --- src/com/gitblit/GitFilter.java | 2 +- src/com/gitblit/models/UserModel.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/gitblit/GitFilter.java b/src/com/gitblit/GitFilter.java index 8ff93b4e..6afdb014 100644 --- a/src/com/gitblit/GitFilter.java +++ b/src/com/gitblit/GitFilter.java @@ -195,7 +195,7 @@ public class GitFilter extends AccessRestrictionFilter { protected RepositoryModel createRepository(UserModel user, String repository, String action) { boolean isPush = !StringUtils.isEmpty(action) && gitReceivePack.equals(action); if (isPush) { - if (user.canCreateOnPush(repository)) { + if (user.canCreate(repository)) { // user is pushing to a new repository // validate name if (repository.startsWith("../")) { diff --git a/src/com/gitblit/models/UserModel.java b/src/com/gitblit/models/UserModel.java index 7995f7e4..77337043 100644 --- a/src/com/gitblit/models/UserModel.java +++ b/src/com/gitblit/models/UserModel.java @@ -366,13 +366,12 @@ public class UserModel implements Principal, Serializable, Comparable } /** - * Returns true if the user is allowed to create the specified repository - * on-push if the repository does not already exist. + * Returns true if the user is allowed to create the specified repository. * * @param repository * @return true if the user can create the repository */ - public boolean canCreateOnPush(String repository) { + public boolean canCreate(String repository) { if (canAdmin()) { // admins can create any repository return true; -- 2.39.5