@@ -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 |
@@ -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()) { |
@@ -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); |