From c05535c2a7e833c5e831e3774b4440d6459918dd Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 26 Oct 2011 17:07:11 -0400
Subject: [PATCH] Documentation.
---
src/com/gitblit/client/GitblitClient.java | 41 +++++++++++++++++++++++++++++++++++------
1 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java
index 76a6731..761283e 100644
--- a/src/com/gitblit/client/GitblitClient.java
+++ b/src/com/gitblit/client/GitblitClient.java
@@ -49,7 +49,9 @@
private final char[] password;
- private volatile boolean isAdmin;
+ private volatile boolean allowManagement;
+
+ 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();
+ refreshStatus();
+ 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) {
@@ -120,6 +135,16 @@
allUsers.clear();
allUsers.addAll(users);
return allUsers;
+ }
+
+ public ServerSettings refreshSettings() throws IOException {
+ settings = RpcUtils.getSettings(url, account, password);
+ return settings;
+ }
+
+ public ServerStatus refreshStatus() throws IOException {
+ status = RpcUtils.getStatus(url, account, password);
+ return status;
}
public List<FederationModel> refreshFederationRegistrations() throws IOException {
@@ -197,4 +222,8 @@
public boolean deleteUser(UserModel user) throws IOException {
return RpcUtils.deleteUser(user, url, account, password);
}
+
+ public boolean updateSettings(Map<String, String> newSettings) throws IOException {
+ return RpcUtils.updateSettings(newSettings, url, account, password);
+ }
}
--
Gitblit v1.9.1