From e0f9398e91d97a5416410c239da769687f203325 Mon Sep 17 00:00:00 2001 From: nkorange Date: Wed, 5 Feb 2020 14:02:15 +0800 Subject: [PATCH] #1105 fix bug --- .../nacos/naming/controllers/CatalogController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java index 8ba536a39..b0270d158 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java @@ -34,6 +34,7 @@ import com.alibaba.nacos.naming.pojo.ClusterInfo; import com.alibaba.nacos.naming.pojo.IpAddressInfo; import com.alibaba.nacos.naming.pojo.ServiceDetailInfo; import com.alibaba.nacos.naming.pojo.ServiceView; +import com.alibaba.nacos.naming.web.NamingResourceParser; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -55,7 +56,7 @@ public class CatalogController { @Autowired protected ServiceManager serviceManager; - @Secured(action = ActionTypes.READ) + @Secured(parser = NamingResourceParser.class, action = ActionTypes.READ) @GetMapping("/service") public JSONObject serviceDetail(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId, String serviceName) throws NacosException { @@ -96,7 +97,7 @@ public class CatalogController { return detailView; } - @Secured(action = ActionTypes.READ) + @Secured(parser = NamingResourceParser.class, action = ActionTypes.READ) @RequestMapping(value = "/instances") public JSONObject instanceList(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId, @RequestParam String serviceName, @@ -138,7 +139,7 @@ public class CatalogController { return result; } - @Secured(resource = "naming/services", action = ActionTypes.READ) + @Secured(parser = NamingResourceParser.class, action = ActionTypes.READ) @GetMapping("/services") public Object listDetail(@RequestParam(required = false) boolean withInstances, @RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,