示例#1
0
 /**
  * Implements the traditional search functionalities for XGroups
  *
  * @param request
  * @return
  */
 @GET
 @Path("/groups")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_GROUPS + "\")")
 public VXGroupList searchXGroups(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, xGroupService.sortFields);
   searchUtil.extractString(request, searchCriteria, "name", "group name", null);
   searchUtil.extractInt(request, searchCriteria, "isVisible", "Group Visibility");
   searchUtil.extractString(request, searchCriteria, "groupSource", "group source", null);
   return xUserMgr.searchXGroups(searchCriteria);
 }
示例#2
0
 @GET
 @Path("/permission/group")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\""
         + RangerAPIList.SEARCH_X_GROUP_PERMISSION
         + "\")")
 public VXGroupPermissionList searchXGroupPermission(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, xGroupPermissionService.sortFields);
   searchUtil.extractString(request, searchCriteria, "id", "id", StringUtil.VALIDATION_NAME);
   searchUtil.extractString(
       request, searchCriteria, "groupPermissionList", "groupId", StringUtil.VALIDATION_NAME);
   return xUserMgr.searchXGroupPermission(searchCriteria);
 }
示例#3
0
 @GET
 @Path("/permission/count")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.COUNT_X_MODULE_DEF + "\")")
 public VXLong countXModuleDef(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, xModuleDefService.sortFields);
   return xUserMgr.getXModuleDefSearchCount(searchCriteria);
 }
示例#4
0
  @GET
  @Path("/permission")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\""
          + RangerAPIList.SEARCH_X_MODULE_DEF
          + "\")")
  public VXModuleDefList searchXModuleDef(@Context HttpServletRequest request) {
    SearchCriteria searchCriteria =
        searchUtil.extractCommonCriterias(request, xModuleDefService.sortFields);

    searchUtil.extractString(request, searchCriteria, "module", "modulename", null);

    searchUtil.extractString(request, searchCriteria, "moduleDefList", "id", null);
    searchUtil.extractString(request, searchCriteria, "userName", "userName", null);
    searchUtil.extractString(request, searchCriteria, "groupName", "groupName", null);

    return xUserMgr.searchXModuleDef(searchCriteria);
  }
示例#5
0
 /**
  * Implements the traditional search functionalities for XPermMaps
  *
  * @param request
  * @return
  */
 @GET
 @Path("/permmaps")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_PERM_MAPS + "\")")
 public VXPermMapList searchXPermMaps(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, xPermMapService.sortFields);
   return xUserMgr.searchXPermMaps(searchCriteria);
 }
示例#6
0
  @GET
  @Path("/auditmaps/count")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.COUNT_X_AUDIT_MAPS + "\")")
  public VXLong countXAuditMaps(@Context HttpServletRequest request) {
    SearchCriteria searchCriteria =
        searchUtil.extractCommonCriterias(request, xAuditMapService.sortFields);

    return xUserMgr.getXAuditMapSearchCount(searchCriteria);
  }
示例#7
0
 /**
  * Implements the traditional search functionalities for XGroupUsers
  *
  * @param request
  * @return
  */
 @GET
 @Path("/groupusers")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\""
         + RangerAPIList.SEARCH_X_GROUP_USERS
         + "\")")
 public VXGroupUserList searchXGroupUsers(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, xGroupUserService.sortFields);
   return xUserMgr.searchXGroupUsers(searchCriteria);
 }
示例#8
0
  /**
   * Implements the traditional search functionalities for XUsers
   *
   * @param request
   * @return
   */
  @GET
  @Path("/users")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_USERS + "\")")
  public VXUserList searchXUsers(@Context HttpServletRequest request) {
    SearchCriteria searchCriteria =
        searchUtil.extractCommonCriterias(request, xUserService.sortFields);

    searchUtil.extractString(request, searchCriteria, "name", "User name", null);
    searchUtil.extractString(request, searchCriteria, "emailAddress", "Email Address", null);
    searchUtil.extractInt(request, searchCriteria, "userSource", "User Source");
    searchUtil.extractInt(request, searchCriteria, "isVisible", "User Visibility");
    searchUtil.extractInt(request, searchCriteria, "status", "User Status");
    searchUtil.extractStringList(
        request, searchCriteria, "userRoleList", "User Role List", "userRoleList", null, null);
    searchUtil.extractString(request, searchCriteria, "userRole", "UserRole", null);
    return xUserMgr.searchXUsers(searchCriteria);
  }
示例#9
0
 @GET
 @Path("/authSessions")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize(
     "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_AUTH_SESSIONS + "\")")
 public VXAuthSessionList getAuthSessions(@Context HttpServletRequest request) {
   SearchCriteria searchCriteria =
       searchUtil.extractCommonCriterias(request, AuthSessionService.AUTH_SESSION_SORT_FLDS);
   searchUtil.extractLong(request, searchCriteria, "id", "Auth Session Id");
   searchUtil.extractLong(request, searchCriteria, "userId", "User Id");
   searchUtil.extractInt(request, searchCriteria, "authStatus", "Auth Status");
   searchUtil.extractInt(request, searchCriteria, "authType", "Auth Type");
   searchUtil.extractInt(request, searchCriteria, "deviceType", "Device Type");
   searchUtil.extractString(
       request, searchCriteria, "firstName", "User First Name", StringUtil.VALIDATION_NAME);
   searchUtil.extractString(
       request, searchCriteria, "lastName", "User Last Name", StringUtil.VALIDATION_NAME);
   searchUtil.extractString(
       request, searchCriteria, "requestUserAgent", "User Agent", StringUtil.VALIDATION_TEXT);
   searchUtil.extractString(
       request,
       searchCriteria,
       "requestIP",
       "Request IP Address",
       StringUtil.VALIDATION_IP_ADDRESS);
   searchUtil.extractString(
       request, searchCriteria, "loginId", "Login ID", StringUtil.VALIDATION_TEXT);
   searchUtil.extractDate(request, searchCriteria, "startDate", "Start date for search", null);
   searchUtil.extractDate(request, searchCriteria, "endDate", "End date for search", null);
   return sessionMgr.searchAuthSessions(searchCriteria);
 }