Changing permissions - /devices/owning to /devices/owning-device

revert-dabc3590
dilanua 8 years ago
parent ac6d0eda84
commit 8d338a584b

@ -21,7 +21,6 @@ package org.wso2.carbon.mdm.services.android.services;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.mdm.services.android.bean.wrapper.*; import org.wso2.carbon.mdm.services.android.bean.wrapper.*;
@ -93,7 +92,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new lock operation.") "Server error occurred while adding a new lock operation.")
}) })
@Permission(name = "Lock Device", permission = "/device-mgt/devices/owning/operations/android/lock") @Permission(name = "Lock Device", permission = "/device-mgt/devices/owning-device/operations/android/lock")
Response configureDeviceLock( Response configureDeviceLock(
@ApiParam(name = "deviceLockBeanWrapper", @ApiParam(name = "deviceLockBeanWrapper",
value = "Device lock configurations with device IDs") DeviceLockBeanWrapper deviceLockBeanWrapper); value = "Device lock configurations with device IDs") DeviceLockBeanWrapper deviceLockBeanWrapper);
@ -147,7 +146,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new un-lock operation.") "Server error occurred while adding a new un-lock operation.")
}) })
@Permission(name = "Unlock Device", permission = "/device-mgt/devices/owning/operations/android/unlock") @Permission(name = "Unlock Device", permission = "/device-mgt/devices/owning-device/operations/android/unlock")
Response configureDeviceUnlock( Response configureDeviceUnlock(
@ApiParam(name = "deviceIDs", value = "DeviceIds to be enable device unlock operation") @ApiParam(name = "deviceIDs", value = "DeviceIds to be enable device unlock operation")
List<String> deviceIDs); List<String> deviceIDs);
@ -200,7 +199,7 @@ public interface DeviceManagementAdminService {
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new get-location operation.")}) "Server error occurred while adding a new get-location operation.")})
@Permission(name = "Get Device Location", permission = "/device-mgt/devices/owning/operations/android/location") @Permission(name = "Get Device Location", permission = "/device-mgt/devices/owning-device/operations/android/location")
Response getDeviceLocation( Response getDeviceLocation(
@ApiParam(name = "deviceIDs", value = "DeviceIDs to be requested to get device location") @ApiParam(name = "deviceIDs", value = "DeviceIDs to be requested to get device location")
List<String> deviceIDs); List<String> deviceIDs);
@ -253,7 +252,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new clear password operation.") "Server error occurred while adding a new clear password operation.")
}) })
@Permission(name = "Clear Password of Device", permission = "/device-mgt/devices/owning/operations/android/clear-password") @Permission(name = "Clear Password of Device", permission = "/device-mgt/devices/owning-device/operations/android/clear-password")
Response removePassword( Response removePassword(
@ApiParam(name = "deviceIDs", @ApiParam(name = "deviceIDs",
value = "DeviceIds to be requested to remove password") List<String> deviceIDs); value = "DeviceIds to be requested to remove password") List<String> deviceIDs);
@ -306,7 +305,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new control camera operation.") "Server error occurred while adding a new control camera operation.")
}) })
@Permission(name = "Manage Camera", permission = "/device-mgt/devices/owning/operations/android/camera") @Permission(name = "Manage Camera", permission = "/device-mgt/devices/owning-device/operations/android/camera")
Response configureCamera( Response configureCamera(
@ApiParam(name = "cameraBeanWrapper", value = "Camera enable/disable configurations with device IDs") @ApiParam(name = "cameraBeanWrapper", value = "Camera enable/disable configurations with device IDs")
CameraBeanWrapper cameraBeanWrapper); CameraBeanWrapper cameraBeanWrapper);
@ -362,7 +361,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new device info operation.") "Server error occurred while adding a new device info operation.")
}) })
@Permission(name = "Get Device Information", permission = "/device-mgt/devices/owning/operations/android/info") @Permission(name = "Get Device Information", permission = "/device-mgt/devices/owning-device/operations/android/info")
Response getDeviceInformation( Response getDeviceInformation(
@ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device information") @ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device information")
List<String> deviceIDs); List<String> deviceIDs);
@ -418,7 +417,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new device logcat operation.") "Server error occurred while adding a new device logcat operation.")
}) })
@Permission(name = "Get Logs", permission = "/device-mgt/devices/owning/operations/android/logcat") @Permission(name = "Get Logs", permission = "/device-mgt/devices/owning-device/operations/android/logcat")
Response getDeviceLogcat( Response getDeviceLogcat(
@ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device logcat") @ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device logcat")
List<String> deviceIDs); List<String> deviceIDs);
@ -472,7 +471,7 @@ public interface DeviceManagementAdminService {
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a enterprise wipe operation.")}) "Server error occurred while adding a enterprise wipe operation.")})
@Permission(name = "Enterprise Wipe", permission = "/device-mgt/devices/owning/operations/android/enterprise-wipe") @Permission(name = "Enterprise Wipe", permission = "/device-mgt/devices/owning-device/operations/android/enterprise-wipe")
Response wipeDevice(@ApiParam(name = "deviceIDs", value = "Device IDs to be requested to do enterprise-wipe") Response wipeDevice(@ApiParam(name = "deviceIDs", value = "Device IDs to be requested to do enterprise-wipe")
List<String> deviceIDs); List<String> deviceIDs);
@ -524,7 +523,7 @@ public interface DeviceManagementAdminService {
code = 500, code = 500,
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a device wipe operation.")}) "Server error occurred while adding a device wipe operation.")})
@Permission(name = "Factory Reset", permission = "/device-mgt/devices/owning/operations/android/wipe") @Permission(name = "Factory Reset", permission = "/device-mgt/devices/owning-device/operations/android/wipe")
Response wipeData( Response wipeData(
@ApiParam(name = "wipeDataBeanWrapper", value = "Configurations and DeviceIds needed to do wipe-data") @ApiParam(name = "wipeDataBeanWrapper", value = "Configurations and DeviceIds needed to do wipe-data")
WipeDataBeanWrapper wipeDataBeanWrapper); WipeDataBeanWrapper wipeDataBeanWrapper);
@ -581,7 +580,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new get-applications operation.") "Server error occurred while adding a new get-applications operation.")
}) })
@Permission(name = "Get Installed Application", permission = "/device-mgt/devices/owning/operations/android/applications") @Permission(name = "Get Installed Application", permission = "/device-mgt/devices/owning-device/operations/android/applications")
Response getApplications( Response getApplications(
@ApiParam(name = "deviceIDs", value = "Device Ids needed to get applications that are already installed") @ApiParam(name = "deviceIDs", value = "Device Ids needed to get applications that are already installed")
List<String> deviceIDs); List<String> deviceIDs);
@ -634,7 +633,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new device ring operation.") "Server error occurred while adding a new device ring operation.")
}) })
@Permission(name = "Ring Device", permission = "/device-mgt/devices/owning/operations/android/ring") @Permission(name = "Ring Device", permission = "/device-mgt/devices/owning-device/operations/android/ring")
Response ringDevice( Response ringDevice(
@ApiParam(name = "deviceIDs", value = "Device Ids needed for ring") @ApiParam(name = "deviceIDs", value = "Device Ids needed for ring")
List<String> deviceIDs); List<String> deviceIDs);
@ -687,7 +686,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new device reboot operation.") "Server error occurred while adding a new device reboot operation.")
}) })
@Permission(name = "Reboot Device", permission = "/device-mgt/devices/owning/operations/android/reboot") @Permission(name = "Reboot Device", permission = "/device-mgt/devices/owning-device/operations/android/reboot")
Response rebootDevice( Response rebootDevice(
@ApiParam(name = "deviceIDs", value = "Device Ids needed for reboot.") @ApiParam(name = "deviceIDs", value = "Device Ids needed for reboot.")
List<String> deviceIDs); List<String> deviceIDs);
@ -740,7 +739,7 @@ public interface DeviceManagementAdminService {
"Server error occurred while adding a new device mute operation.") "Server error occurred while adding a new device mute operation.")
}) })
@Path("/mute") @Path("/mute")
@Permission(name = "Mute Device", permission = "/device-mgt/devices/owning/operations/android/mute") @Permission(name = "Mute Device", permission = "/device-mgt/devices/owning-device/operations/android/mute")
Response muteDevice( Response muteDevice(
@ApiParam(name = "deviceIDs", value = "DeviceIDs need to be muted") @ApiParam(name = "deviceIDs", value = "DeviceIDs need to be muted")
List<String> deviceIDs); List<String> deviceIDs);
@ -796,7 +795,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new install-application operation.") "Server error occurred while adding a new install-application operation.")
}) })
@Permission(name = "Install Applications", permission = "/device-mgt/devices/owning/operations/android/install-app") @Permission(name = "Install Applications", permission = "/device-mgt/devices/owning-device/operations/android/install-app")
Response installApplication( Response installApplication(
@ApiParam(name = "applicationInstallationBeanWrapper", value = "Properties of installed apps and device IDs") @ApiParam(name = "applicationInstallationBeanWrapper", value = "Properties of installed apps and device IDs")
ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper);
@ -852,7 +851,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new update-application operation.") "Server error occurred while adding a new update-application operation.")
}) })
@Permission(name = "Update installed applications", permission = "/device-mgt/devices/owning/operations/android/update-app") @Permission(name = "Update installed applications", permission = "/device-mgt/devices/owning-device/operations/android/update-app")
Response updateApplication( Response updateApplication(
@ApiParam(name = "applicationUpdateBeanWrapper", value = "Properties of updated apps and device IDs") @ApiParam(name = "applicationUpdateBeanWrapper", value = "Properties of updated apps and device IDs")
ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper);
@ -905,7 +904,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new uninstall-application operation.") "Server error occurred while adding a new uninstall-application operation.")
}) })
@Permission(name = "Uninstall Applications", permission = "/device-mgt/devices/owning/operations/android/uninstall-app") @Permission(name = "Uninstall Applications", permission = "/device-mgt/devices/owning-device/operations/android/uninstall-app")
Response uninstallApplication( Response uninstallApplication(
@ApiParam(name = "applicationUninstallationBeanWrapper", @ApiParam(name = "applicationUninstallationBeanWrapper",
value = "applicationUninstallationConfigs and Device Ids") value = "applicationUninstallationConfigs and Device Ids")
@ -960,7 +959,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new blacklist-applications operation.") "Server error occurred while adding a new blacklist-applications operation.")
}) })
@Permission(name = "Blacklist Applications", permission = "/device-mgt/devices/owning/operations/android/blacklist-app") @Permission(name = "Blacklist Applications", permission = "/device-mgt/devices/owning-device/operations/android/blacklist-app")
Response blacklistApplications( Response blacklistApplications(
@ApiParam(name = "blacklistApplicationsBeanWrapper", value = "BlacklistApplications " + @ApiParam(name = "blacklistApplicationsBeanWrapper", value = "BlacklistApplications " +
"Configuration and DeviceIds") "Configuration and DeviceIds")
@ -1015,7 +1014,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new upgrade firmware operation.") "Server error occurred while adding a new upgrade firmware operation.")
}) })
@Permission(name = "Upgrade Firmware", permission = "/device-mgt/devices/owning/operations/android/upgrade") @Permission(name = "Upgrade Firmware", permission = "/device-mgt/devices/owning-device/operations/android/upgrade")
Response upgradeFirmware( Response upgradeFirmware(
@ApiParam(name = "upgradeFirmwareBeanWrapper", @ApiParam(name = "upgradeFirmwareBeanWrapper",
value = "Firmware upgrade configuration and DeviceIds") value = "Firmware upgrade configuration and DeviceIds")
@ -1070,7 +1069,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new configure VPN operation.") "Server error occurred while adding a new configure VPN operation.")
}) })
@Permission(name = "Add VPN", permission = "/device-mgt/devices/owning/operations/android/vpn") @Permission(name = "Add VPN", permission = "/device-mgt/devices/owning-device/operations/android/vpn")
Response configureVPN( Response configureVPN(
@ApiParam(name = "vpnBeanWrapper", @ApiParam(name = "vpnBeanWrapper",
value = "VPN configuration and DeviceIds") value = "VPN configuration and DeviceIds")
@ -1124,7 +1123,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new send notification operation.") "Server error occurred while adding a new send notification operation.")
}) })
@Permission(name = "Send Notifications", permission = "/device-mgt/devices/owning/operations/android/notification") @Permission(name = "Send Notifications", permission = "/device-mgt/devices/owning-device/operations/android/notification")
Response sendNotification( Response sendNotification(
@ApiParam(name = "notificationBeanWrapper", @ApiParam(name = "notificationBeanWrapper",
value = "Notification Configurations and device Ids") value = "Notification Configurations and device Ids")
@ -1178,7 +1177,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new configure wifi operation.") "Server error occurred while adding a new configure wifi operation.")
}) })
@Permission(name = "Add Wifi Configuration", permission = "/device-mgt/devices/owning/operations/android/wifi") @Permission(name = "Add Wifi Configuration", permission = "/device-mgt/devices/owning-device/operations/android/wifi")
Response configureWifi( Response configureWifi(
@ApiParam(name = "wifiBeanWrapper", @ApiParam(name = "wifiBeanWrapper",
value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper); value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper);
@ -1231,7 +1230,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new encrypt storage operation.") "Server error occurred while adding a new encrypt storage operation.")
}) })
@Permission(name = "Encrypt Device", permission = "/device-mgt/devices/owning/operations/android/encrypt") @Permission(name = "Encrypt Device", permission = "/device-mgt/devices/owning-device/operations/android/encrypt")
Response encryptStorage( Response encryptStorage(
@ApiParam(name = "encryptionBeanWrapper", @ApiParam(name = "encryptionBeanWrapper",
value = "Configurations and deviceIds need to be done data encryption") value = "Configurations and deviceIds need to be done data encryption")
@ -1285,7 +1284,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new change lock code operation.") "Server error occurred while adding a new change lock code operation.")
}) })
@Permission(name = "Change Password of Device", permission = "/device-mgt/devices/owning/operations/android/change-lock") @Permission(name = "Change Password of Device", permission = "/device-mgt/devices/owning-device/operations/android/change-lock")
Response changeLockCode( Response changeLockCode(
@ApiParam(name = "lockCodeBeanWrapper", @ApiParam(name = "lockCodeBeanWrapper",
value = "Configurations and device Ids need to be done change lock code") value = "Configurations and device Ids need to be done change lock code")
@ -1339,7 +1338,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new set password policy operation.") "Server error occurred while adding a new set password policy operation.")
}) })
@Permission(name = "Set Password Policy", permission = "/device-mgt/devices/owning/operations/android/password-policy") @Permission(name = "Set Password Policy", permission = "/device-mgt/devices/owning-device/operations/android/password-policy")
Response setPasswordPolicy( Response setPasswordPolicy(
@ApiParam(name = "passwordPolicyBeanWrapper", @ApiParam(name = "passwordPolicyBeanWrapper",
value = "Password Policy Configurations and Device Ids") value = "Password Policy Configurations and Device Ids")
@ -1393,7 +1392,7 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " + message = "Internal Server Error. \n " +
"Server error occurred while adding a new set webclip operation.") "Server error occurred while adding a new set webclip operation.")
}) })
@Permission(name = "Add Webclips", permission = "/device-mgt/devices/owning/operations/android/webclip") @Permission(name = "Add Webclips", permission = "/device-mgt/devices/owning-device/operations/android/webclip")
Response setWebClip( Response setWebClip(
@ApiParam(name = "webClipBeanWrapper", @ApiParam(name = "webClipBeanWrapper",
value = "Configurations to need set web clip on device and device Ids") value = "Configurations to need set web clip on device and device Ids")

@ -22,7 +22,7 @@ function onRequest(context) {
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
var viewModel = {}; var viewModel = {};
var permissions = {}; var permissions = {};
permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view");
permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view");
permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view");

@ -22,7 +22,7 @@ function onRequest(context){
// permission checks // permission checks
// [1] checking viewing devices permission // [1] checking viewing devices permission
viewModel["isAuthorized"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); viewModel["isAuthorized"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view");
if (viewModel["isAuthorized"]) { if (viewModel["isAuthorized"]) {
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) { context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {

@ -29,10 +29,10 @@ function onRequest() {
userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/windows"); userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/windows");
// [2] checking advanced device search permissions // [2] checking advanced device search permissions
permissions["ADVANCED_SEARCH"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); permissions["ADVANCED_SEARCH"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view");
// [3] checking device viewing permission // [3] checking device viewing permission
permissions["VIEW_DEVICES"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); permissions["VIEW_DEVICES"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view");
var currentUser = session.get(constants["USER_SESSION_KEY"]); var currentUser = session.get(constants["USER_SESSION_KEY"]);

@ -24,40 +24,40 @@ function onRequest(context) {
// adding android operations related permission checks // adding android operations related permission checks
permissions["android"] = []; permissions["android"] = [];
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/ring")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/ring")) {
permissions["android"].push("DEVICE_RING"); permissions["android"].push("DEVICE_RING");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/lock-devices")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/lock-devices")) {
permissions["android"].push("DEVICE_LOCK"); permissions["android"].push("DEVICE_LOCK");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/unlock-devices")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/unlock-devices")) {
permissions["android"].push("DEVICE_UNLOCK"); permissions["android"].push("DEVICE_UNLOCK");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/location")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/location")) {
permissions["android"].push("DEVICE_LOCATION"); permissions["android"].push("DEVICE_LOCATION");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/clear-password")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/clear-password")) {
permissions["android"].push("CLEAR_PASSWORD"); permissions["android"].push("CLEAR_PASSWORD");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/reboot")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/reboot")) {
permissions["android"].push("DEVICE_REBOOT"); permissions["android"].push("DEVICE_REBOOT");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/upgrade-firmware")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/upgrade-firmware")) {
permissions["android"].push("UPGRADE_FIRMWARE"); permissions["android"].push("UPGRADE_FIRMWARE");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/mute")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/mute")) {
permissions["android"].push("DEVICE_MUTE"); permissions["android"].push("DEVICE_MUTE");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/send-notification")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/send-notification")) {
permissions["android"].push("NOTIFICATION"); permissions["android"].push("NOTIFICATION");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/change-lock-code")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/change-lock-code")) {
permissions["android"].push("CHANGE_LOCK_CODE"); permissions["android"].push("CHANGE_LOCK_CODE");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/enterprise-wipe")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/enterprise-wipe")) {
permissions["android"].push("ENTERPRISE_WIPE"); permissions["android"].push("ENTERPRISE_WIPE");
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/wipe")) { if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/wipe")) {
permissions["android"].push("WIPE_DATA"); permissions["android"].push("WIPE_DATA");
} }

@ -45,7 +45,7 @@ function onRequest(context) {
viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"]; viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"];
var currentUser = session.get(constants["USER_SESSION_KEY"]); var currentUser = session.get(constants["USER_SESSION_KEY"]);
var permissions = {}; var permissions = {};
permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view");
permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view");
permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view");

@ -49,7 +49,7 @@ public interface DeviceManagementAdminService {
@POST @POST
@Path("/lock-devices") @Path("/lock-devices")
@Permission(name = "Lock Device", permission = "/device-mgt/devices/owning/operations/windows/lock") @Permission(name = "Lock Device", permission = "/device-mgt/devices/owning-device/operations/windows/lock")
Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@ -61,19 +61,19 @@ public interface DeviceManagementAdminService {
@POST @POST
@Path("/wipe-devices") @Path("/wipe-devices")
@Permission(name = "Wipe Device", permission = "/device-mgt/devices/owning/operations/windows/wipe") @Permission(name = "Wipe Device", permission = "/device-mgt/devices/owning-device/operations/windows/wipe")
Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/ring-devices") @Path("/ring-devices")
@Permission(name = "Ring Device", permission = "/device-mgt/devices/owning/operations/windows/ring") @Permission(name = "Ring Device", permission = "/device-mgt/devices/owning-device/operations/windows/ring")
Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws
WindowsDeviceEnrolmentException; WindowsDeviceEnrolmentException;
@POST @POST
@Path("/lockreset-devices") @Path("/lockreset-devices")
@Permission(name = "Lock-Reset Device", permission = "/device-mgt/devices/owning/operations/windows/lockreset") @Permission(name = "Lock-Reset Device", permission = "/device-mgt/devices/owning-device/operations/windows/lock-reset")
Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceIds) Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceIds)
throws WindowsDeviceEnrolmentException; throws WindowsDeviceEnrolmentException;
} }

Loading…
Cancel
Save