Skip to content

Commit

Permalink
Simplify project access level determination (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
petebachant authored Jan 2, 2025
1 parent a1fe5a3 commit b9aa485
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions backend/app/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ def get_project(
):
project.current_user_access = "owner"
break
if project.is_public:
if project.current_user_access is None and project.is_public:
project.current_user_access = "read"
if (
not project.is_public
and not project.current_user_access == "owner"
):
raise HTTPException(403)
elif project.is_public:
elif project.is_public and project.current_user_access is None:
project.current_user_access = "read"
else:
if project.current_user_access is None:
raise HTTPException(403)
access_levels = {
level: n
Expand Down

0 comments on commit b9aa485

Please sign in to comment.