diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index a87877d6dc..232074d687 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -161,6 +161,7 @@ "perm:device:enroll", "perm:geo-service:analytics-view", "perm:geo-service:alerts-manage", + "perm:devices:permanent-delete", "appm:read" ], "isOAuthEnabled": true, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index 25f92f9c7a..344206796c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -623,6 +623,9 @@ var userModule = function () { if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/update-enrollment")) { permissions["UPDATE_ENROLLMENT"] = true; } + if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/permanent-delete")) { + permissions["PERMANENT_DELETE"] = true; + } return permissions; }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs index c0fe171866..53cb478806 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs @@ -23,7 +23,7 @@ {{#equal enrolmentInfo.status "ACTIVE"}} Active{{/equal}} {{#equal enrolmentInfo.status "INACTIVE"}} Inactive{{/equal}} {{#equal enrolmentInfo.status "BLOCKED"}} Blocked{{/equal}} - {{#equal enrolmentInfo.status "REMOVED"}} Removed{{/equal}} + {{#equal enrolmentInfo.status "REMOVED"}} Removed{{/equal}} {{type}} {{enrolmentInfo.ownership}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs index cb067c464c..3a12ea975e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs @@ -218,15 +218,31 @@ data-toggle="modal" data-target="#modalDemo"> - + {{#if group}} Remove from group {{else}} - Remove Device + Dis-enroll Device {{/if}} + + {{#if permissions.permanentDelete}} +
  • + + + + + + Delete Device + +
  • + {{/if}} + {{#if permissions.updateEnrollment}}
  • @@ -423,6 +439,58 @@ +
    + + + +
    + +
    + + + +
    +
    +
    + + + +
    +