From b9aa485a7086ff090292c04368950628b59c4df9 Mon Sep 17 00:00:00 2001 From: Pete Bachant Date: Thu, 2 Jan 2025 08:09:51 -0800 Subject: [PATCH] Simplify project access level determination (#264) --- backend/app/projects.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/app/projects.py b/backend/app/projects.py index fceacc3c..6f54d07c 100644 --- a/backend/app/projects.py +++ b/backend/app/projects.py @@ -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