diff options
author | James Moger <james.moger@gitblit.com> | 2011-10-23 10:25:39 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-10-23 10:25:39 -0400 |
commit | d03aff630cbcd49f02d51f08ec59ac3cf7f41d0e (patch) | |
tree | a523cdbbf325ecfe22e73a4f5939e3d93fa8f432 /src/com/gitblit/client/GitblitClient.java | |
parent | 16038ce2adf5f06f75230150f75d110a804414c1 (diff) | |
download | gitblit-d03aff630cbcd49f02d51f08ec59ac3cf7f41d0e.tar.gz gitblit-d03aff630cbcd49f02d51f08ec59ac3cf7f41d0e.zip |
Separate management from administration in rpc servlet.
Added skeleton mechanism to update server settings via rpc.
Diffstat (limited to 'src/com/gitblit/client/GitblitClient.java')
-rw-r--r-- | src/com/gitblit/client/GitblitClient.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java index 76a67316..66675b16 100644 --- a/src/com/gitblit/client/GitblitClient.java +++ b/src/com/gitblit/client/GitblitClient.java @@ -48,8 +48,10 @@ public class GitblitClient implements Serializable { 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 @@ public class GitblitClient implements Serializable { refreshRepositories();
try {
+ refreshUsers();
+ allowManagement = true;
+ } catch (UnauthorizedException e) {
+ } catch (ForbiddenException e) {
+ } catch (IOException e) {
+ System.err.println(e.getMessage());
+ }
+
+ try {
settings = RpcUtils.getSettings(url, account, password);
status = RpcUtils.getStatus(url, account, password);
- refreshUsers();
- isAdmin = true;
+ 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) {
|