Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #5
0
 @POST
 @Path("/groupusers")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXGroupUser createXGroupUser(VXGroupUser vXGroupUser) {
   return xUserMgr.createXGroupUser(vXGroupUser);
 }
Example #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);
 }
Example #7
0
 @POST
 @Path("/users")
 @Produces({"application/xml", "application/json"})
 @PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
 public VXUser createXUser(VXUser vXUser) {
   return xUserMgr.createXUserWithOutLogin(vXUser);
 }
Example #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);
 }
Example #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);
 }
Example #10
0
  @PUT
  @Path("/secure/users/{id}")
  @Produces({"application/xml", "application/json"})
  public VXUser secureUpdateXUser(VXUser vXUser) {

    bizUtil.checkUserAccessible(vXUser);
    return xUserMgr.updateXUser(vXUser);
  }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
  }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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());
 }
Example #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());
 }
Example #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);
  }
Example #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;
 }
Example #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;
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }