summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/User.java
blob: e506c8cb84eac2a0b9390cb3332bd40cdeac8e60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.gitblit.wicket;

import com.gitblit.Build;
import com.gitblit.Constants;

public class User {

	private String username;
	private String cookie;
	private boolean canAdmin = false;
	private boolean canClone = false;
	private boolean canPush = false;

	public User(String username, char[] password) {
		this.username = username;
		this.cookie = Build.getSHA1((Constants.NAME + username + new String(password)).getBytes());
	}

	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 cookie;
	}

	public String toString() {
		return username;
	}
}