diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java index 1fae1c525e1..52c59d753fd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java @@ -253,7 +253,12 @@ public class AnnotationProcessor { this.setPermission(annotations[i], permission); } } - permissions.add(permission); + if (permission.getName() == null || permission.getPath() == null) { + log.warn("Permission not assigned to the resource url - " + permission.getMethod() + ":" + + permission.getUrl()); + } else { + permissions.add(permission); + } } } return permissions;