@DELETE @Path("/users/{id}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") @RangerAnnotationClassName(class_name = VXUser.class) public void deleteXUser(@PathParam("id") Long id, @Context HttpServletRequest request) { String forceDeleteStr = request.getParameter("forceDelete"); boolean forceDelete = false; if (!StringUtils.isEmpty(forceDeleteStr) && forceDeleteStr.equalsIgnoreCase("true")) { forceDelete = true; } xUserMgr.deleteXUser(id, forceDelete); }
@DELETE @Path("/users/userName/{userName}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public void deleteXUserByUserName( @PathParam("userName") String userName, @Context HttpServletRequest request) { String forceDeleteStr = request.getParameter("forceDelete"); boolean forceDelete = false; if (!StringUtils.isEmpty(forceDeleteStr) && forceDeleteStr.equalsIgnoreCase("true")) { forceDelete = true; } VXUser vxUser = xUserService.getXUserByUserName(userName); xUserMgr.deleteXUser(vxUser.getId(), forceDelete); }
@DELETE @Path("/secure/users/delete") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public void deleteUsersByUserName(@Context HttpServletRequest request, VXStringList userList) { String forceDeleteStr = request.getParameter("forceDelete"); boolean forceDelete = false; if (StringUtils.isNotEmpty(forceDeleteStr) && "true".equalsIgnoreCase(forceDeleteStr)) { forceDelete = true; } if (userList != null && userList.getList() != null) { for (VXString userName : userList.getList()) { if (StringUtils.isNotEmpty(userName.getValue())) { VXUser vxUser = xUserService.getXUserByUserName(userName.getValue()); xUserMgr.deleteXUser(vxUser.getId(), forceDelete); } } } }