Skip to content

Commit

Permalink
feat: nn security trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
allanhvam committed May 21, 2024
1 parent 91f8649 commit 7fa1001
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/SAP/src/controllers/NearestNeighborsController.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ def post(user, token, body: NearestNeighborsRequest):
def get_result(id: str):
row = get_single_analysis_by_object_id(id)

if (
token["sofi-data-clearance"] == "own-institution"
and token["institution"] != row["institution"]
):
return None
return get_analysis_with_metadata(row["sequence_id"])

result = list(map(lambda r : get_result(r["id"]), response_dict["result"]))
result = list(filter(lambda x: x is not None, list(map(lambda r : get_result(r["id"]), response_dict["result"]))))

return jsonify({"status": api_response.status.value,
"jobId": api_response.job_id,
Expand Down

0 comments on commit 7fa1001

Please sign in to comment.