@PUT @Path("/permission/{id}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_X_MODULE_DEF_PERMISSION + "\")") public VXModuleDef updateXModuleDefPermission(VXModuleDef vXModuleDef) { xUserMgr.checkAdminAccess(); return xUserMgr.updateXModuleDefPermission(vXModuleDef); }
// Handle user permissions @POST @Path("/permission/user") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.CREATE_X_USER_PERMISSION + "\")") public VXUserPermission createXUserPermission(VXUserPermission vXUserPermission) { xUserMgr.checkAdminAccess(); return xUserMgr.createXUserPermission(vXUserPermission); }
@DELETE @Path("/permission/user/{id}") @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.DELETE_X_USER_PERMISSION + "\")") public void deleteXUserPermission(@PathParam("id") Long id, @Context HttpServletRequest request) { boolean force = true; xUserMgr.checkAdminAccess(); xUserMgr.deleteXUserPermission(id, force); }
@PUT @Path("/permission/group/{id}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_X_GROUP_PERMISSION + "\")") public VXGroupPermission updateXGroupPermission(VXGroupPermission vXGroupPermission) { xUserMgr.checkAdminAccess(); return xUserMgr.updateXGroupPermission(vXGroupPermission); }
@POST @Path("/groupusers") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public VXGroupUser createXGroupUser(VXGroupUser vXGroupUser) { return xUserMgr.createXGroupUser(vXGroupUser); }
@POST @Path("/users/userinfo") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public VXUserGroupInfo createXUserGroupFromMap(VXUserGroupInfo vXUserGroupInfo) { return xUserMgr.createXUserGroupFromMap(vXUserGroupInfo); }
@POST @Path("/users") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public VXUser createXUser(VXUser vXUser) { return xUserMgr.createXUserWithOutLogin(vXUser); }
@POST @Path("/secure/groups") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public VXGroup secureCreateXGroup(VXGroup vXGroup) { return xUserMgr.createXGroup(vXGroup); }
@GET @Path("/secure/users/{id}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SECURE_GET_X_USER + "\")") public VXUser secureGetXUser(@PathParam("id") Long id) { return xUserMgr.getXUser(id); }
@PUT @Path("/secure/users/{id}") @Produces({"application/xml", "application/json"}) public VXUser secureUpdateXUser(VXUser vXUser) { bizUtil.checkUserAccessible(vXUser); return xUserMgr.updateXUser(vXUser); }
// Handle XGroupGroup @GET @Path("/groupgroups/{id}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_GROUP_GROUP + "\")") public VXGroupGroup getXGroupGroup(@PathParam("id") Long id) { return xUserMgr.getXGroupGroup(id); }
@DELETE @Path("/groupgroups/{id}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") @RangerAnnotationClassName(class_name = VXGroupGroup.class) public void deleteXGroupGroup(@PathParam("id") Long id, @Context HttpServletRequest request) { boolean force = false; xUserMgr.deleteXGroupGroup(id, force); }
@DELETE @Path("/group/{groupName}/user/{userName}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public void deleteXGroupAndXUser( @PathParam("groupName") String groupName, @PathParam("userName") String userName, @Context HttpServletRequest request) { xUserMgr.deleteXGroupAndXUser(groupName, userName); }
@GET @Path("/{groupId}/users") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_GROUP_USERS + "\")") public VXUserList getXGroupUsers( @Context HttpServletRequest request, @PathParam("groupId") Long id) { return xUserMgr.getXGroupUsers(id); }
@POST @Path("/secure/users") @Produces({"application/xml", "application/json"}) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public VXUser secureCreateXUser(VXUser vXUser) { bizUtil.checkUserAccessible(vXUser); return xUserMgr.createXUser(vXUser); }
@DELETE @Path("/auditmaps/{id}") @RangerAnnotationClassName(class_name = VXAuditMap.class) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.DELETE_X_AUDIT_MAP + "\")") public void deleteXAuditMap(@PathParam("id") Long id, @Context HttpServletRequest request) { boolean force = false; xUserMgr.deleteXAuditMap(id, force); }
/** * 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); }
@PUT @Path("/secure/users/activestatus") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.MODIFY_USER_ACTIVE_STATUS + "\")") public void modifyUserActiveStatus(HashMap<Long, Integer> statusMap) { xUserMgr.modifyUserActiveStatus(statusMap); }
@PUT @Path("/secure/users/visibility") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.MODIFY_USER_VISIBILITY + "\")") public void modifyUserVisibility(HashMap<Long, Integer> visibilityMap) { xUserMgr.modifyUserVisibility(visibilityMap); }
@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); }
@GET @Path("/permission/user/{id}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_USER_PERMISSION + "\")") public VXUserPermission getXUserPermission(@PathParam("id") Long id) { return xUserMgr.getXUserPermission(id); }
// Handle XUser @GET @Path("/users/userName/{userName}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_USER_BY_USER_NAME + "\")") public VXUser getXUserByUserName( @Context HttpServletRequest request, @PathParam("userName") String userName) { return xUserMgr.getXUserByUserName(userName); }
@PUT @Path("/secure/users/roles/userName/{userName}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SET_USER_ROLES_BY_NAME + "\")") public VXStringList setUserRolesByName( @PathParam("userName") String userName, VXStringList roleList) { return xUserMgr.setUserRolesByName(userName, roleList.getVXStrings()); }
@PUT @Path("/secure/users/roles/{userId}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SET_USER_ROLES_BY_ID + "\")") public VXStringList setUserRolesByExternalID( @PathParam("userId") Long userId, VXStringList roleList) { return xUserMgr.setUserRolesByExternalID(userId, roleList.getVXStrings()); }
@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); }
@GET @Path("/secure/users/external/{userId}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_USER_ROLES_BY_ID + "\")") public VXStringList getUserRolesByExternalID(@PathParam("userId") Long userId) { VXStringList vXStringList = new VXStringList(); vXStringList = xUserMgr.getUserRolesByExternalID(userId); return vXStringList; }
@GET @Path("/secure/users/roles/userName/{userName}") @Produces({"application/xml", "application/json"}) @PreAuthorize( "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_USER_ROLES_BY_NAME + "\")") public VXStringList getUserRolesByName(@PathParam("userName") String userName) { VXStringList vXStringList = new VXStringList(); vXStringList = xUserMgr.getUserRolesByName(userName); return vXStringList; }
/** * 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); }
@DELETE @Path("/users/{id}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") @RangerAnnotationClassName(class_name = VXUser.class) public void deleteXUser(@PathParam("id") Long id, @Context HttpServletRequest request) { String forceDeleteStr = request.getParameter("forceDelete"); boolean forceDelete = false; if (!StringUtils.isEmpty(forceDeleteStr) && forceDeleteStr.equalsIgnoreCase("true")) { forceDelete = true; } xUserMgr.deleteXUser(id, forceDelete); }
@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); }