James Moger
2012-10-03 f22a0633d08e38ac4bf92b5165a708e11b4d6598
src/com/gitblit/models/UserModel.java
@@ -36,6 +36,8 @@
   private static final long serialVersionUID = 1L;
   public static final UserModel ANONYMOUS = new UserModel();
   // field names are reflectively mapped in EditUser page
   public String username;
   public String password;
@@ -54,6 +56,11 @@
   public UserModel(String username) {
      this.username = username;
      this.isAuthenticated = true;
   }
   private UserModel() {
      this.username = "anonymous";
      this.isAuthenticated = false;
   }
   /**
@@ -86,6 +93,16 @@
      return false;
   }
   
   public boolean canViewRepository(RepositoryModel repository) {
      if (canAdmin) {
         return true;
      }
      if (repository.accessRestriction.atLeast(AccessRestrictionType.VIEW)) {
         return canAccessRepository(repository);
      }
      return true;
   }
   public boolean canForkRepository(RepositoryModel repository) {
      if (canAdmin) {
         return true;