From: James Moger Date: Thu, 23 Aug 2012 22:05:51 +0000 (-0400) Subject: Clearing the cache via RPC no longer requires admin credentials X-Git-Tag: v1.1.0~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ebaf603fa9789e3e34802bdf72b15859ee95e24;p=gitblit.git Clearing the cache via RPC no longer requires admin credentials --- 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 LIST_REPOSITORY_TEAMSrepository nameadmin2-List<String> SET_REPOSITORY_TEAMSrepository nameadmin2List<String>- LIST_SETTINGS-admin1-ServerSettings (management keys) +CLEAR_REPOSITORY_CACHE--4-- web.enableRpcAdministration=true LIST_FEDERATION_REGISTRATIONS-admin1-List<FederationModel> LIST_FEDERATION_RESULTS-admin1-List<FederationModel> @@ -102,7 +103,6 @@ The Gitblit API includes methods for retrieving and interpreting RSS feeds. The LIST_SETTINGS-admin1-ServerSettings (all keys) EDIT_SETTINGS-admin1Map<String, String>- LIST_STATUS-admin1-ServerStatus (see example below) -CLEAR_REPOSITORY_CACHE-admin4-- ### 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);