code: @Path("/{roleName}/users/{cuid}")
      @ApiOperation(value="Delete a role or remove a user from a role",
          notes="If users/{cuid} is present, user is removed from role.", response=StatusMessage.class)
      public JSONObject delete(String path, JSONObject content, Map<String,String> headers)
      throws ServiceException, JSONException {
          String name = getSegment(path, 1);
          String rel = getSegment(path, 2);
  
          UserServices userServices = ServiceLocator.getUserServices();
          try {
              if (rel == null) {
                  userServices.deleteRole(name);
                }
                else if (rel.equals("users")) {
                    String cuid = getSegment(path, 3);
                    userServices.removeUserFromRole(cuid, name);
                }
          }
          catch (DataAccessException ex) {
              throw new ServiceException(HTTP_500_INTERNAL_ERROR, ex.getMessage(), ex);
          }
          return null;
      }
docs: Delete workgroup or remove user from group.