diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/OperationMetadata.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/OperationMetadata.java index 81a4139d8e..9fc9715f4d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/OperationMetadata.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/OperationMetadata.java @@ -58,6 +58,7 @@ import java.util.List; "method", "contentType", "permission", + "scope", "filterList" }) public class OperationMetadata { @@ -74,6 +75,9 @@ public class OperationMetadata { @XmlElement(name = "permission") private String permission; + @XmlElement(name = "scope") + private String scope; + @XmlElementWrapper(name = "filters") @XmlElement(name = "filter") private List filterList; @@ -110,6 +114,14 @@ public class OperationMetadata { this.permission = permission; } + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + public List getFilterList() { return filterList; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/feature/ConfigurationBasedFeatureManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/feature/ConfigurationBasedFeatureManager.java index 1043628369..95c702041f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/feature/ConfigurationBasedFeatureManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/feature/ConfigurationBasedFeatureManager.java @@ -63,6 +63,7 @@ public class ConfigurationBasedFeatureManager implements FeatureManager { private static final String OPERATION_META = "operationMeta"; private static final String CONTENT_TYPE = "contentType"; private static final String PERMISSION = "permission"; + private static final String SCOPE = "scope"; private static final String ICON = "icon"; private static final String FILTERS = "filters"; private static final String PATH_PARAMS = "pathParams"; @@ -108,6 +109,9 @@ public class ConfigurationBasedFeatureManager implements FeatureManager { if (StringUtils.isNotEmpty(metadata.getPermission())) { operationMeta.put(PERMISSION, metadata.getPermission()); } + if (StringUtils.isNotEmpty(metadata.getScope())) { + operationMeta.put(SCOPE, metadata.getScope()); + } if (metadata.getFilterList() != null && metadata.getFilterList().size() > 0) { operationMeta.put(FILTERS, metadata.getFilterList()); } diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java index b94309be57..acddc17ce9 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java @@ -80,5 +80,5 @@ public class HandlerConstants { public static final String IOT_GW_HOST_ENV_VAR = "iot.gateway.host"; public static final String IOT_GW_HTTP_PORT_ENV_VAR = "iot.gateway.http.port"; public static final String IOT_GW_HTTPS_PORT_ENV_VAR = "iot.gateway.https.port"; - public static final String USER_SCOPES = "user-scopes"; + public static final String USER_SCOPES = "userScopes"; } diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index eba51b1d84..36fe025034 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -180,6 +180,7 @@ perm:metadata:create perm:metadata:update perm:android:google-account + perm:android:update-default-sim device-mgt