Skip to content

Commit

Permalink
cohorts, datasets scoping fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfk committed Dec 16, 2024
1 parent 5530cd0 commit 5c153f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bento_beacon/endpoints/cohorts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

@route_with_optional_project_id("/cohorts", methods=["GET", "POST"])
@authz_middleware.deco_public_endpoint
def get_cohorts():
def get_cohorts(project_id=None):
cohorts = current_app.config["BEACON_COHORT"]
return beacon_collections_response({"collections": cohorts})


@route_with_optional_project_id("/cohorts/<id>", methods=["GET", "POST"])
@authz_middleware.deco_public_endpoint
def get_cohort_by_id(id):
def get_cohort_by_id(id, project_id=None):
cohorts = current_app.config["BEACON_COHORT"]
cohort_this_id = next((c for c in cohorts if c.get("id") == id), [])
return beacon_collections_response({"collections": cohort_this_id})
Expand Down
2 changes: 1 addition & 1 deletion bento_beacon/endpoints/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def get_datasets(project_id=None):

@route_with_optional_project_id("/datasets/<id>", methods=["GET", "POST"])
@authz_middleware.deco_public_endpoint # TODO: authz - more flexibility in what is visible (?)
async def get_datasets_by_id(id):
async def get_datasets_by_id(id, project_id=None):
k_dataset = await katsu_dataset_by_id(id=id)
dataset_beacon_format = katsu_to_beacon_dataset_mapping(k_dataset) if k_dataset else []
return beacon_collections_response({"collections": dataset_beacon_format})
Expand Down

0 comments on commit 5c153f2

Please sign in to comment.