James Moger
2011-10-24 f306ef8552efe1580e9c16e1d944f5ed1dca4aae
src/com/gitblit/client/GitblitClient.java
@@ -48,8 +48,10 @@
   public final String account;
   private final char[] password;
   private volatile boolean allowManagement;
   private volatile boolean isAdmin;
   private volatile boolean allowAdministration;
   private volatile ServerSettings settings;
@@ -75,19 +77,32 @@
      refreshRepositories();
      try {
         settings = RpcUtils.getSettings(url, account, password);
         status = RpcUtils.getStatus(url, account, password);
         refreshUsers();
         isAdmin = true;
         allowManagement = true;
      } catch (UnauthorizedException e) {
      } catch (ForbiddenException e) {
      } catch (IOException e) {
         System.err.println(e.getMessage());
      }
      try {
         refreshSettings();
         status = RpcUtils.getStatus(url, account, password);
         allowAdministration = true;
      } catch (UnauthorizedException e) {
      } catch (ForbiddenException e) {
      } catch (IOException e) {
         System.err.println(e.getMessage());
      }
   }
   public boolean allowAdmin() {
      return isAdmin;
   public boolean allowManagement() {
      return allowManagement;
   }
   public boolean allowAdministration() {
      return allowAdministration;
   }
   public boolean isOwner(RepositoryModel model) {
@@ -121,6 +136,11 @@
      allUsers.addAll(users);
      return allUsers;
   }
   public ServerSettings refreshSettings() throws IOException {
      settings = RpcUtils.getSettings(url, account, password);
      return settings;
   }
   public List<FederationModel> refreshFederationRegistrations() throws IOException {
      List<FederationModel> list = RpcUtils.getFederationRegistrations(url, account, password);