From 0bbcac4a93f284f8c5e18b6fbb64d9fc9e5e3c68 Mon Sep 17 00:00:00 2001 From: osh Date: Fri, 10 Mar 2023 09:11:40 +0530 Subject: [PATCH] Add enrollment guide permissions fixes https://roadmap.entgra.net/issues/9939 --- .../mgt/jaxrs/service/api/DeviceManagementService.java | 9 ++++++++- .../src/main/resources/conf/mdm-ui-config.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 2b9a2254f21..874b46db3d8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -189,6 +189,13 @@ import java.util.List; roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/add"} ), + @Scope( + name = "Viewing Enrollment Guide", + description = "Show enrollment guide to users", + key = "perm:devices:enrollment-guide:view", + roles = {"Internal/devicemgt-user"}, + permissions = {"/device-mgt/devices/enrollment-guide/view"} + ), } ) @Path("/devices") @@ -816,7 +823,7 @@ public interface DeviceManagementService { tags = "Device Management", extensions = { @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:view") + @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:enrollment-guide:view") }) } ) 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 d36e26a3ccb..64010515b0b 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 @@ -100,6 +100,7 @@ perm:devices:details perm:devices:update perm:devices:view + perm:devices:enrollment-guide:view perm:view-configuration perm:manage-configuration perm:policies:remove