From f94e9bb866b3c1da7059705216bbc178fb65b3e1 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Fri, 7 Feb 2014 10:42:03 +0100 Subject: [PATCH] Fix validation of plugin capability on REST view that handles PUT on collection If a plugin has a REST collection that accepts PUT requests and the REST view that handles these PUT requests is annotated with @RequiresCapability to require a plugin capability then the validation of this capability in Gerrit core fails since the plugin name is not forwarded to the capability check. Because of the missing plugin name the capability check is looking for a Gerrit core capability although it should check for a plugin capability. Change-Id: I9779bd04b4b849bd8c3646a3e226b07faf3e9cc3 Signed-off-by: Edwin Kempin --- .../java/com/google/gerrit/httpd/restapi/RestApiServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java index 26c42062a6..ce450dc3c2 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java @@ -270,7 +270,7 @@ public class RestApiServlet extends HttpServlet { || "PUT".equals(req.getMethod()))) { @SuppressWarnings("unchecked") AcceptsCreate ac = (AcceptsCreate) c; - viewData = new ViewData(null, ac.create(rsrc, id)); + viewData = new ViewData(viewData.pluginName, ac.create(rsrc, id)); status = SC_CREATED; } else { throw e;