From: James Moger Date: Mon, 22 Oct 2012 20:07:14 +0000 (-0400) Subject: Renamed method to UserModel.canCreate(String repository) X-Git-Tag: v1.2.0~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec7ac2149ba8603ff1455c948c07037bf6ee030c;p=gitblit.git Renamed method to UserModel.canCreate(String repository) --- 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;