Ejemplo n.º 1
0
 @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);
 }
Ejemplo n.º 2
0
 @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);
       }
     }
   }
 }