Example #1
0
 @DELETE
 @Path("/groups/groupName/{groupName}")
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public void deleteXGroupByGroupName(
     @PathParam("groupName") String groupName, @Context HttpServletRequest request) {
   String forceDeleteStr = request.getParameter("forceDelete");
   boolean forceDelete = false;
   if (!StringUtils.isEmpty(forceDeleteStr) && forceDeleteStr.equalsIgnoreCase("true")) {
     forceDelete = true;
   }
   VXGroup vxGroup = xGroupService.getGroupByGroupName(groupName);
   xUserMgr.deleteXGroup(vxGroup.getId(), forceDelete);
 }
Example #2
0
 @DELETE
 @Path("/secure/groups/delete")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public void deleteGroupsByGroupName(@Context HttpServletRequest request, VXStringList groupList) {
   String forceDeleteStr = request.getParameter("forceDelete");
   boolean forceDelete = false;
   if (StringUtils.isNotEmpty(forceDeleteStr) && "true".equalsIgnoreCase(forceDeleteStr)) {
     forceDelete = true;
   }
   if (groupList != null && groupList.getList() != null) {
     for (VXString groupName : groupList.getList()) {
       if (StringUtils.isNotEmpty(groupName.getValue())) {
         VXGroup vxGroup = xGroupService.getGroupByGroupName(groupName.getValue());
         xUserMgr.deleteXGroup(vxGroup.getId(), forceDelete);
       }
     }
   }
 }