]> source.dussan.org Git - gitblit.git/commitdiff
Clearing the cache via RPC no longer requires admin credentials
authorJames Moger <james.moger@gitblit.com>
Thu, 23 Aug 2012 22:05:51 +0000 (18:05 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 23 Aug 2012 22:05:51 +0000 (18:05 -0400)
docs/02_rpc.mkd
src/com/gitblit/Constants.java
src/com/gitblit/RpcServlet.java

index 6089ac9bbde25832a14c1f9a1f38abe082499e97..d05ca27f99737bbca5dd874668d33e9d4726a333 100644 (file)
@@ -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&lt;String&gt;</td></tr>\r
 <tr><td>SET_REPOSITORY_TEAMS</td><td>repository name</td><td><em>admin</em></td><td>2</td><td>List&lt;String&gt;</td><td>-</td></tr>\r
 <tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (management keys)</td></tr>\r
+<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>-</em></td><td>4</td><td>-</td><td>-</td></tr>\r
 <tr><td colspan='6'><em>web.enableRpcAdministration=true</em></td></tr>\r
 <tr><td>LIST_FEDERATION_REGISTRATIONS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List&lt;FederationModel&gt;</td></tr>\r
 <tr><td>LIST_FEDERATION_RESULTS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List&lt;FederationModel&gt;</td></tr>\r
@@ -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>\r
 <tr><td>EDIT_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>Map&lt;String, String&gt;</td><td>-</td></tr>\r
 <tr><td>LIST_STATUS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerStatus (see example below)</td></tr>\r
-<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>admin</em></td><td>4</td><td>-</td><td>-</td></tr>\r
 </table>\r
 \r
 ### RPC/HTTP Response Codes\r
index 5f3bea9f4b909a13658679a330fbcde2fcbca858..d07638c220bba86f3952226ff7e4e6f37dd13c02 100644 (file)
@@ -242,13 +242,13 @@ public class Constants {
        public static enum RpcRequest {\r
                // Order is important here.  anything above LIST_SETTINGS requires\r
                // administrator privileges and web.allowRpcManagement.\r
-               GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, LIST_SETTINGS,\r
+               CLEAR_REPOSITORY_CACHE, GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, LIST_SETTINGS,\r
                CREATE_REPOSITORY, EDIT_REPOSITORY, DELETE_REPOSITORY, \r
                LIST_USERS, CREATE_USER, EDIT_USER, DELETE_USER, \r
                LIST_TEAMS, CREATE_TEAM, EDIT_TEAM, DELETE_TEAM,\r
                LIST_REPOSITORY_MEMBERS, SET_REPOSITORY_MEMBERS, LIST_REPOSITORY_TEAMS, SET_REPOSITORY_TEAMS, \r
                LIST_FEDERATION_REGISTRATIONS, LIST_FEDERATION_RESULTS, LIST_FEDERATION_PROPOSALS, LIST_FEDERATION_SETS,\r
-               EDIT_SETTINGS, LIST_STATUS, CLEAR_REPOSITORY_CACHE;\r
+               EDIT_SETTINGS, LIST_STATUS;\r
 \r
                public static RpcRequest fromName(String name) {\r
                        for (RpcRequest type : values()) {\r
index 929e9cc67c0403a663eb20d01908b67171452700..ff98ff55b0163af4ff4b3563a9db5929ccae262e 100644 (file)
@@ -321,7 +321,7 @@ public class RpcServlet extends JsonServlet {
                        }\r
                } else if (RpcRequest.CLEAR_REPOSITORY_CACHE.equals(reqType)) {\r
                        // clear the repository list cache\r
-                       if (allowAdmin) {\r
+                       if (allowManagement) {\r
                                GitBlit.self().resetRepositoryListCache();\r
                        } else {\r
                                response.sendError(notAllowedCode);\r