use of org.apache.ranger.common.SearchCriteria in project ranger by apache.
the class XUserREST method searchXUserPermission.
@GET
@Path("/permission/user")
@Produces({ "application/xml", "application/json" })
@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_USER_PERMISSION + "\")")
public VXUserPermissionList searchXUserPermission(@Context HttpServletRequest request) {
SearchCriteria searchCriteria = searchUtil.extractCommonCriterias(request, xUserPermissionService.sortFields);
searchUtil.extractString(request, searchCriteria, "id", "id", StringUtil.VALIDATION_NAME);
searchUtil.extractString(request, searchCriteria, "userPermissionList", "userId", StringUtil.VALIDATION_NAME);
return xUserMgr.searchXUserPermission(searchCriteria);
}
use of org.apache.ranger.common.SearchCriteria in project ranger by apache.
the class XUserREST method searchXModuleDef.
@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);
}
use of org.apache.ranger.common.SearchCriteria in project ranger by apache.
the class XUserREST method searchXGroupPermission.
@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);
}
use of org.apache.ranger.common.SearchCriteria in project ranger by apache.
the class XUserREST method getAuthSessions.
@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", "Login 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", null);
searchUtil.extractDate(request, searchCriteria, "endDate", "End Date", null);
return sessionMgr.searchAuthSessions(searchCriteria);
}
use of org.apache.ranger.common.SearchCriteria in project ranger by apache.
the class XUserREST method searchXGroups.
/**
* 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);
// searchUtil.extractInt(request, searchCriteria, "groupSource", "group source");
return xUserMgr.searchXGroups(searchCriteria);
}
Aggregations