X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fweb%2Froot%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fweb%2FDaylightWebAdmin.java;h=c748171685ebcbe7886229987d1eda67c62d03ab;hb=refs%2Fchanges%2F47%2F447%2F2;hp=46b8d4e0fe5e0329299a5671a6440ae801fbc853;hpb=60ba2f16a5cfa1bc7bcfa0089df544225c70a4cd;p=controller.git diff --git a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java index 46b8d4e0fe..c748171685 100644 --- a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java +++ b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java @@ -95,7 +95,7 @@ public class DaylightWebAdmin { return userManager.removeLocalUser(userName).getDescription(); } - + @RequestMapping(value = "/users/password/{username}", method = RequestMethod.POST) @ResponseBody public Status changePassword(@PathVariable("username") String username, HttpServletRequest request, @@ -105,23 +105,23 @@ public class DaylightWebAdmin { if (userManager == null) { return new Status(StatusCode.GONE, "User Manager not found"); } - + if (!authorize(userManager, UserLevel.NETWORKADMIN, request)) { return new Status(StatusCode.FORBIDDEN, "Operation not permitted"); } - + if (newPassword.isEmpty()) { return new Status(StatusCode.BADREQUEST, "Empty passwords not allowed"); } - + Status status = userManager.changeLocalUserPassword(username, currentPassword, newPassword); - + return status; } /** * Is the operation permitted for the given level - * + * * @param level */ private boolean authorize(IUserManager userManager, UserLevel level,