From 43cf6b8e67d8785283dca80add77849062381aed Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 28 Jun 2021 14:07:18 +0530 Subject: [PATCH] adding user roles to apis --- .../DeviceManagementAdminService.java | 52 +++++++++---------- .../services/DeviceManagementService.java | 4 +- .../DeviceTypeConfigurationService.java | 6 +-- .../services/EventReceiverService.java | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index 303996462..0f59e0666 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -71,182 +71,182 @@ import java.util.List; name = "Lock Device", description = "Hard lock own device", key = "perm:android:lock-devices", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/lock"} ), @Scope( name = "Unlock Device", description = "Unlock permanently locked device", key = "perm:android:unlock-devices", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/unlock"} ), @Scope( name = "Get Location", description = "Request device location coordinates", key = "perm:android:location", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/location"} ), @Scope( name = "Clear Password", description = "Clear the password on Android devices", key = "perm:android:clear-password", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/clear-password"} ), @Scope( name = "Control Camera", description = "Enabling or Disabling the Camera on Android Devices", key = "perm:android:control-camera", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/camera"} ), @Scope( name = "Get Info", description = "Requesting device information from Android Devices", key = "perm:android:info", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/info"} ), @Scope( name = "Get Logs", description = "Requesting Logcat Details from Android Devices", key = "perm:android:logcat", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/logcat"} ), @Scope( name = "Enterprise Wipe", description = "Enterprise Wiping Android Devices", key = "perm:android:enterprise-wipe", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/enterprise-wipe"} ), @Scope( name = "Factory Reset", description = "Factory Resetting Android Devices", key = "perm:android:wipe", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/wipe"} ), @Scope( name = "Get Installed Applications", description = "Get list of installed applications", key = "perm:android:applications", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/applications"} ), @Scope( name = "Ring Device", description = "Ring Android devices", key = "perm:android:ring", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/ring"} ), @Scope( name = "Reboot Device", description = "Reboot Android devices", key = "perm:android:reboot", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/reboot"} ), @Scope( name = "Mute Device", description = "Mute Android devices", key = "perm:android:mute", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/mute"} ), @Scope( name = "Install Applications", description = "Installing an Application on Android Devices", key = "perm:android:install-application", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/install-app"} ), @Scope( name = "Update Applications", description = "Updating an Application on Android Devices", key = "perm:android:update-application", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/update-app"} ), @Scope( name = "Uninstall Applications", description = "Uninstalling an Application on Android Devices", key = "perm:android:uninstall-application", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/uninstall-app"} ), @Scope( name = "Blacklist Applications", description = "Blacklisting applications on Android Devices", key = "perm:android:blacklist-applications", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/blacklist-app"} ), @Scope( name = "Upgrade Firmware", description = "Upgrading Firmware of Android Devices", key = "perm:android:upgrade-firmware", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/upgrade"} ), @Scope( name = "Configure VPN", description = "Configure VPN on Android Device", key = "perm:android:configure-vpn", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/vpn"} ), @Scope( name = "Send Notification", description = "Sending a notification to Android Device", key = "perm:android:send-notification", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/send-notification"} ), @Scope( name = "Configure Wi-Fi", description = "Configure Wi-Fi on Android Device", key = "perm:android:configure-wifi", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/wifi"} ), @Scope( name = "Encrypt Storage", description = "Encrypting storage on Android Device", key = "perm:android:encrypt-storage", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/encrypt"} ), @Scope( name = "Change Password", description = "Changing the lock code of an Android Device", key = "perm:android:change-lock-code", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/change-lock-code"} ), @Scope( name = "Password Policy", description = "Set password policy of an Android Device", key = "perm:android:set-password-policy", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/password-policy"} ), @Scope( name = "Add Web clip", description = "Setting a Web Clip on Android Devices", key = "perm:android:set-webclip", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/webclip"} ), @Scope( name = "File Transfer", description = "Transferring a file to android devices", key = "perm:android:file-transfer", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/operations/android/file-transfer"} ) } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java index 97214ebf8..48cf3ee0a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java @@ -71,14 +71,14 @@ import java.util.List; name = "Enroll Device", description = "Register an Android device", key = "perm:android:enroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/enroll/android"} ), @Scope( name = "Un-enroll Device", description = "Unregister an Android device", key = "perm:android:disenroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/disenroll/android"} ) } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java index 0e0b955b0..dc7bc1262 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java @@ -68,21 +68,21 @@ import javax.ws.rs.core.Response; name = "Enroll Device", description = "Register an Android device", key = "perm:android:enroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/enroll/android"} ), @Scope( name = "View Configurations", description = "Getting Android Platform Configurations", key = "perm:android:view-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/enroll/android"} ), @Scope( name = "Manage Configurations", description = "Updating Android Platform Configurations", key = "perm:android:manage-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/platform-configurations/manage"} ) } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java index 88624d0c3..e76e76e0f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java @@ -68,7 +68,7 @@ import javax.ws.rs.core.Response; name = "Enroll Device", description = "Register an Android device", key = "perm:android:enroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/enroll/android"} ) }