diff options
author | James Moger <james.moger@gitblit.com> | 2012-08-23 18:05:51 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-08-23 18:05:51 -0400 |
commit | 4ebaf603fa9789e3e34802bdf72b15859ee95e24 (patch) | |
tree | f9b2367519aaddb35c03bb507a191494a61330d2 | |
parent | 2904bfeca5fbb219bebb552142ff881f28de831c (diff) | |
download | gitblit-4ebaf603fa9789e3e34802bdf72b15859ee95e24.tar.gz gitblit-4ebaf603fa9789e3e34802bdf72b15859ee95e24.zip |
Clearing the cache via RPC no longer requires admin credentials
-rw-r--r-- | docs/02_rpc.mkd | 2 | ||||
-rw-r--r-- | src/com/gitblit/Constants.java | 4 | ||||
-rw-r--r-- | src/com/gitblit/RpcServlet.java | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/docs/02_rpc.mkd b/docs/02_rpc.mkd index 6089ac9b..d05ca27f 100644 --- a/docs/02_rpc.mkd +++ b/docs/02_rpc.mkd @@ -94,6 +94,7 @@ The Gitblit API includes methods for retrieving and interpreting RSS feeds. The <tr><td>LIST_REPOSITORY_TEAMS</td><td>repository name</td><td><em>admin</em></td><td>2</td><td>-</td><td>List<String></td></tr>
<tr><td>SET_REPOSITORY_TEAMS</td><td>repository name</td><td><em>admin</em></td><td>2</td><td>List<String></td><td>-</td></tr>
<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (management keys)</td></tr>
+<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>-</em></td><td>4</td><td>-</td><td>-</td></tr>
<tr><td colspan='6'><em>web.enableRpcAdministration=true</em></td></tr>
<tr><td>LIST_FEDERATION_REGISTRATIONS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr>
<tr><td>LIST_FEDERATION_RESULTS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr>
@@ -102,7 +103,6 @@ The Gitblit API includes methods for retrieving and interpreting RSS feeds. The <tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (all keys)</td></tr>
<tr><td>EDIT_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>Map<String, String></td><td>-</td></tr>
<tr><td>LIST_STATUS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerStatus (see example below)</td></tr>
-<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>admin</em></td><td>4</td><td>-</td><td>-</td></tr>
</table>
### RPC/HTTP Response Codes
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 5f3bea9f..d07638c2 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -242,13 +242,13 @@ public class Constants { public static enum RpcRequest {
// Order is important here. anything above LIST_SETTINGS requires
// administrator privileges and web.allowRpcManagement.
- GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, LIST_SETTINGS,
+ CLEAR_REPOSITORY_CACHE, GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, LIST_SETTINGS,
CREATE_REPOSITORY, EDIT_REPOSITORY, DELETE_REPOSITORY,
LIST_USERS, CREATE_USER, EDIT_USER, DELETE_USER,
LIST_TEAMS, CREATE_TEAM, EDIT_TEAM, DELETE_TEAM,
LIST_REPOSITORY_MEMBERS, SET_REPOSITORY_MEMBERS, LIST_REPOSITORY_TEAMS, SET_REPOSITORY_TEAMS,
LIST_FEDERATION_REGISTRATIONS, LIST_FEDERATION_RESULTS, LIST_FEDERATION_PROPOSALS, LIST_FEDERATION_SETS,
- EDIT_SETTINGS, LIST_STATUS, CLEAR_REPOSITORY_CACHE;
+ EDIT_SETTINGS, LIST_STATUS;
public static RpcRequest fromName(String name) {
for (RpcRequest type : values()) {
diff --git a/src/com/gitblit/RpcServlet.java b/src/com/gitblit/RpcServlet.java index 929e9cc6..ff98ff55 100644 --- a/src/com/gitblit/RpcServlet.java +++ b/src/com/gitblit/RpcServlet.java @@ -321,7 +321,7 @@ public class RpcServlet extends JsonServlet { }
} else if (RpcRequest.CLEAR_REPOSITORY_CACHE.equals(reqType)) {
// clear the repository list cache
- if (allowAdmin) {
+ if (allowManagement) {
GitBlit.self().resetRepositoryListCache();
} else {
response.sendError(notAllowedCode);
|