summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/User.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-04-14 18:29:10 -0400
committerJames Moger <james.moger@gitblit.com>2011-04-14 18:29:10 -0400
commitfc948cacef9c9b8c0a1e84cbc082ca67cd5f68d9 (patch)
tree4287442c5d74c26c3e4826bc79d02c804cd0f8c4 /src/com/gitblit/wicket/User.java
parent94b96b5a98bef254128ccc4f5fc0e0c4376324e4 (diff)
downloadgitblit-fc948cacef9c9b8c0a1e84cbc082ca67cd5f68d9.tar.gz
gitblit-fc948cacef9c9b8c0a1e84cbc082ca67cd5f68d9.zip
Authenticate the webapp against the same realm as the git servlet.
Right now the implementation is hard-coded to pass the realm into a singleton. This won't work for a WAR distribution so I will need to figure out how to properly authenticate the webapp using form authentication and the git servlet using basic authentication - host against the same realm.
Diffstat (limited to 'src/com/gitblit/wicket/User.java')
-rw-r--r--src/com/gitblit/wicket/User.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/gitblit/wicket/User.java b/src/com/gitblit/wicket/User.java
index fb49b404..c23b849c 100644
--- a/src/com/gitblit/wicket/User.java
+++ b/src/com/gitblit/wicket/User.java
@@ -7,12 +7,39 @@ public class User {
private String username;
private char [] password;
+ private boolean canAdmin = false;
+ private boolean canClone = false;
+ private boolean canPush = false;
public User(String username, char [] password) {
this.username = username;
this.password = password;
}
+ public void canAdmin(boolean value) {
+ canAdmin = value;
+ }
+
+ public boolean canAdmin() {
+ return canAdmin;
+ }
+
+ public void canClone(boolean value) {
+ canClone = value;
+ }
+
+ public boolean canClone() {
+ return canClone;
+ }
+
+ public void canPush(boolean value) {
+ canPush = value;
+ }
+
+ public boolean canPush() {
+ return canPush;
+ }
+
public String getCookie() {
return Build.getSHA1((Constants.NAME + username + new String(password)).getBytes());
}