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

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