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

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