From fc9a9ca2107915a2bb2a6f2614d3f5ffa7c54f77 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 13 Jul 2021 09:28:30 +0530 Subject: [PATCH] fixed permission issues --- .../mgt/jaxrs/service/api/DeviceManagementService.java | 7 +++++++ .../carbon/device/mgt/core/DeviceManagementConstants.java | 1 + 2 files changed, 8 insertions(+) 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 de81d28918..eb1d952491 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 @@ -180,6 +180,13 @@ import java.util.List; roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/change-status"} ), + @Scope( + name = "Enroll Device", + description = "Register a device", + key = "perm:device:enroll", + roles = {"Internal/devicemgt-user"}, + permissions = {"/device-mgt/devices/owning-device/add"} + ), } ) @Path("/devices") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java index 1d0f581451..e9cfa13398 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java @@ -167,6 +167,7 @@ public final class DeviceManagementConstants { new Permission("/permission/admin/device-mgt/devices/enroll", "ui.execute"), new Permission("/permission/admin/device-mgt/devices/disenroll", "ui.execute"), new Permission("/permission/admin/device-mgt/devices/owning-device/view", "ui.execute"), + new Permission("/permission/admin/device-mgt/metadata", "ui.execute"), new Permission("/permission/admin/manage/portal", "ui.execute") };