Ejemplo n.º 1
0
 @DELETE
 @Path("/groups/{id}")
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 @RangerAnnotationClassName(class_name = VXGroup.class)
 public void deleteXGroup(@PathParam("id") Long id, @Context HttpServletRequest request) {
   String forceDeleteStr = request.getParameter("forceDelete");
   boolean forceDelete = false;
   if (!StringUtils.isEmpty(forceDeleteStr) && "true".equalsIgnoreCase(forceDeleteStr.trim())) {
     forceDelete = true;
   }
   xUserMgr.deleteXGroup(id, forceDelete);
 }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
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);
       }
     }
   }
 }