summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2015-06-30 08:53:06 -0400
committerJames Moger <james.moger@gmail.com>2015-06-30 08:53:06 -0400
commit124fd6e639b0bc43f3714134d6dead77895fd490 (patch)
tree107a4c0bd7481a9873d5d63b76a35ab21e5c5964
parentbebc2e8c8eb66cbb49998fceef01cdde8e0dc934 (diff)
parent2db6b39fdff61ce48788767ad475632a1b29f831 (diff)
downloadgitblit-124fd6e639b0bc43f3714134d6dead77895fd490.tar.gz
gitblit-124fd6e639b0bc43f3714134d6dead77895fd490.zip
Merge pull request #282 from mrjoel/mrjoel-fixhttpurlperms
fix permission capping for HTTP/HTTPS
-rw-r--r--src/main/java/com/gitblit/manager/ServicesManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java
index 5a957a17..c911f31a 100644
--- a/src/main/java/com/gitblit/manager/ServicesManager.java
+++ b/src/main/java/com/gitblit/manager/ServicesManager.java
@@ -166,13 +166,14 @@ public class ServicesManager implements IServicesManager {
settings.getBoolean(Keys.web.showHttpServletUrls, true)) {
AccessPermission permission = user.getRepositoryPermission(repository).permission;
if (permission.exceeds(AccessPermission.NONE)) {
- Transport transport = Transport.fromString(request.getScheme());
+ String repoUrl = getRepositoryUrl(request, username, repository);
+ Transport transport = Transport.fromUrl(repoUrl);
if (permission.atLeast(AccessPermission.PUSH) && !acceptsPush(transport)) {
// downgrade the repo permission for this transport
// because it is not an acceptable PUSH transport
permission = AccessPermission.CLONE;
}
- list.add(new RepositoryUrl(getRepositoryUrl(request, username, repository), permission));
+ list.add(new RepositoryUrl(repoUrl, permission));
}
}