Ejemplo n.º 1
0
  @PUT
  @Path("/permmaps")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_X_PERM_MAP + "\")")
  public VXPermMap updateXPermMap(VXPermMap vXPermMap) {

    if (vXPermMap != null) {
      if (xResourceService.readResource(vXPermMap.getResourceId()) == null) {
        throw restErrorUtil.createRESTException(
            "Invalid Input Data - No resource found with Id: " + vXPermMap.getResourceId());
      }
    }

    return xUserMgr.updateXPermMap(vXPermMap);
  }
Ejemplo n.º 2
0
  @POST
  @Path("/auditmaps")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.CREATE_X_AUDIT_MAP + "\")")
  public VXAuditMap createXAuditMap(VXAuditMap vXAuditMap) {

    if (vXAuditMap != null) {
      if (xResourceService.readResource(vXAuditMap.getResourceId()) == null) {
        throw restErrorUtil.createRESTException(
            "Invalid Input Data - No resource found with Id: " + vXAuditMap.getResourceId(),
            MessageEnums.INVALID_INPUT_DATA);
      }
    }

    return xUserMgr.createXAuditMap(vXAuditMap);
  }
Ejemplo n.º 3
0
  // Handle XPermMap
  @GET
  @Path("/permmaps/{id}")
  @Produces({"application/xml", "application/json"})
  @PreAuthorize(
      "@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_PERM_MAP + "\")")
  public VXPermMap getXPermMap(@PathParam("id") Long id) {
    VXPermMap permMap = xUserMgr.getXPermMap(id);

    if (permMap != null) {
      if (xResourceService.readResource(permMap.getResourceId()) == null) {
        throw restErrorUtil.createRESTException(
            "Invalid Input Data - No resource found with Id: " + permMap.getResourceId(),
            MessageEnums.INVALID_INPUT_DATA);
      }
    }

    return permMap;
  }