diff options
author | Luca Milanesio <luca.milanesio@gmail.com> | 2012-08-14 09:07:42 +0200 |
---|---|---|
committer | Luca Milanesio <luca@milanesio.org> | 2012-10-20 02:53:24 +0100 |
commit | 85f639aa3eee0b4e02eba20e6a5197b684941544 (patch) | |
tree | ef08a5119540cb7eb7d502a4ae4b40f2cae6be57 /src/com/gitblit/models | |
parent | c658df9e87d65b08d5482cf04489cb0532ff83dd (diff) | |
download | gitblit-85f639aa3eee0b4e02eba20e6a5197b684941544.tar.gz gitblit-85f639aa3eee0b4e02eba20e6a5197b684941544.zip |
Allows integration of GitBlit as plug-in in other projects.
There are now three new targets on the ANT build:
- buildJAR: creates a GitBlit JAR including the GitBlit biz logic
- installMaven: install GitBlit JAR as Maven module
- uploadMaven: uploads GitBlit JAR to a Maven repository
Additional extensions have been made to allow:
a) GitBlit to load his resources outside of Wicket domain
b) GitBlit to use an injected UserService
c) Generic authentication of HTTP Request using 3rd party logic
d) Load settings programmatically from an InputStream
e) Use cookie authentication OR generic HTTP Request
authentication for Wicket pages
f) UserModel with branch-level security logic
Diffstat (limited to 'src/com/gitblit/models')
-rw-r--r-- | src/com/gitblit/models/UserModel.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/gitblit/models/UserModel.java b/src/com/gitblit/models/UserModel.java index 8b3fe826..f14c1ae8 100644 --- a/src/com/gitblit/models/UserModel.java +++ b/src/com/gitblit/models/UserModel.java @@ -217,7 +217,7 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel> return permission;
}
- private boolean canAccess(RepositoryModel repository, AccessRestrictionType ifRestriction, AccessPermission requirePermission) {
+ protected boolean canAccess(RepositoryModel repository, AccessRestrictionType ifRestriction, AccessPermission requirePermission) {
if (repository.accessRestriction.atLeast(ifRestriction)) {
AccessPermission permission = getRepositoryPermission(repository);
return permission.atLeast(requirePermission);
@@ -433,4 +433,9 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel> }
return nameVerified && emailVerified;
}
+
+ public boolean hasBranchPermission(String repositoryName, String branch) {
+ // Default UserModel doesn't implement branch-level security. Other Realms (i.e. Gerrit) may override this method.
+ return hasRepositoryPermission(repositoryName);
+ }
}
|