コード例 #1
0
 @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);
 }
コード例 #2
0
 // 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);
 }
コード例 #3
0
 @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);
 }
コード例 #4
0
 @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);
 }
コード例 #5
0
 @POST
 @Path("/groupusers")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXGroupUser createXGroupUser(VXGroupUser vXGroupUser) {
   return xUserMgr.createXGroupUser(vXGroupUser);
 }
コード例 #6
0
 @POST
 @Path("/users/userinfo")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXUserGroupInfo createXUserGroupFromMap(VXUserGroupInfo vXUserGroupInfo) {
   return xUserMgr.createXUserGroupFromMap(vXUserGroupInfo);
 }
コード例 #7
0
 @POST
 @Path("/users")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXUser createXUser(VXUser vXUser) {
   return xUserMgr.createXUserWithOutLogin(vXUser);
 }
コード例 #8
0
 @POST
 @Path("/secure/groups")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXGroup secureCreateXGroup(VXGroup vXGroup) {
   return xUserMgr.createXGroup(vXGroup);
 }
コード例 #9
0
 @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);
 }
コード例 #10
0
  @PUT
  @Path("/secure/users/{id}")
  @Produces({"application/xml", "application/json"})
  public VXUser secureUpdateXUser(VXUser vXUser) {

    bizUtil.checkUserAccessible(vXUser);
    return xUserMgr.updateXUser(vXUser);
  }
コード例 #11
0
 // 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);
 }
コード例 #12
0
 @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);
 }
コード例 #13
0
 @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);
 }
コード例 #14
0
 @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);
 }
コード例 #15
0
  @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);
  }
コード例 #16
0
 @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);
 }
コード例 #17
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);
 }
コード例 #18
0
 @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);
 }
コード例 #19
0
 @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);
 }
コード例 #20
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);
 }
コード例 #21
0
 @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);
 }
コード例 #22
0
 // 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);
 }
コード例 #23
0
 @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());
 }
コード例 #24
0
 @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());
 }
コード例 #25
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);
  }
コード例 #26
0
 @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;
 }
コード例 #27
0
 @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;
 }
コード例 #28
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);
 }
コード例 #29
0
 @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);
 }
コード例 #30
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);
 }