You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.gitblit.wicket;
  2. import java.io.Serializable;
  3. import com.gitblit.Constants;
  4. import com.gitblit.utils.StringUtils;
  5. public class User implements Serializable {
  6. private static final long serialVersionUID = 1L;
  7. private String username;
  8. private String cookie;
  9. private boolean canAdmin = false;
  10. private boolean canClone = false;
  11. private boolean canPush = false;
  12. public User(String username, char[] password) {
  13. this.username = username;
  14. this.cookie = StringUtils.getSHA1((Constants.NAME + username + new String(password)));
  15. }
  16. public void canAdmin(boolean value) {
  17. canAdmin = value;
  18. }
  19. public boolean canAdmin() {
  20. return canAdmin;
  21. }
  22. public void canClone(boolean value) {
  23. canClone = value;
  24. }
  25. public boolean canClone() {
  26. return canClone;
  27. }
  28. public void canPush(boolean value) {
  29. canPush = value;
  30. }
  31. public boolean canPush() {
  32. return canPush;
  33. }
  34. public String getCookie() {
  35. return cookie;
  36. }
  37. public String toString() {
  38. return username;
  39. }
  40. }