Skip to content

Commit

Permalink
Fixing permissions on threshold update endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
bergsalex committed Oct 29, 2024
1 parent 9e7564d commit 4c5f43d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/geneweaver/api/services/geneset.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,17 @@ def update_geneset_threshold(
if user is None or user.id is None:
return {"error": True, "message": message.ACCESS_FORBIDDEN}

if not db_geneset.user_is_owner(
cursor=cursor, user_id=user.id, geneset_id=geneset_id
):
try:
db_threshold.set_geneset_threshold(
cursor=cursor,
user_id=user.id,
geneset_id=geneset_id,
geneset_score_type=geneset_score,
)

except ValueError:
return {"error": True, "message": message.ACCESS_FORBIDDEN}

db_threshold.set_geneset_threshold(
cursor=cursor,
user_id=user.id,
geneset_id=geneset_id,
geneset_score_type=geneset_score,
)
return {}

except Exception as err:
Expand Down

0 comments on commit 4c5f43d

Please sign in to comment.