From d8e057abdd524701b30773921e8b000d6d4c0a28 Mon Sep 17 00:00:00 2001 From: dilanua Date: Tue, 20 Sep 2016 15:28:45 +0530 Subject: [PATCH] Fix for JIRA: https://wso2.org/jira/browse/EMM-1582 --- .../device/mgt/jaxrs/service/api/UserManagementService.java | 3 +-- .../cdmf.unit.ui.header.user-menu/public/js/user-menu.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index ce403fa281..356aa7afef 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.jaxrs.service.api; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; -import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.device.mgt.jaxrs.beans.*; import javax.ws.rs.*; @@ -471,7 +470,7 @@ public interface UserManagementService { "Server error occurred while updating credentials of the user.", response = ErrorResponse.class) }) - @Permission(name = "View Users", permission = "/device-mgt/users/view") + @Permission(name = "Reset user password", permission = "/login") Response resetPassword( @ApiParam( name = "username", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js index 1d13d169ee..a622f40543 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js @@ -64,8 +64,8 @@ $(document).ready(function () { $(errorMsgWrapper).removeClass("hidden"); } else { var changePasswordFormData = {}; - changePasswordFormData.currentPassword = unescape((currentPassword)); - changePasswordFormData.newPassword = unescape((newPassword)); + changePasswordFormData["oldPassword"] = unescape((currentPassword)); + changePasswordFormData["newPassword"] = unescape((newPassword)); var changePasswordAPI = "/api/device-mgt/v1.0/users/" + user + "/credentials";