77from fastapi import Security , HTTPException , status as status_codes
88
99from . import settings , db
10+ from .globals import PRIVATE_SPACE
1011
1112
1213logger = logging .getLogger ("simqueue" )
@@ -75,6 +76,8 @@ def username(self):
7576 return self .preferred_username
7677
7778 async def can_view (self , collab ):
79+ if collab == f"{ PRIVATE_SPACE } -{ self .username } " :
80+ return True
7881 # first of all, check team permissions
7982 target_team_names = {
8083 role : f"collab-{ collab } -{ role } " for role in ("viewer" , "editor" , "administrator" )
@@ -91,6 +94,8 @@ async def can_view(self, collab):
9194 return collab_info .get ("isPublic" , False )
9295
9396 def can_edit (self , collab ):
97+ if collab == f"{ PRIVATE_SPACE } -{ self .username } " :
98+ return True
9499 target_team_names = {
95100 role : f"collab-{ collab } -{ role } " for role in ("editor" , "administrator" )
96101 }
@@ -99,7 +104,7 @@ def can_edit(self, collab):
99104 return True
100105
101106 def get_collabs (self , access = ["viewer" , "editor" , "administrator" ]):
102- collabs = set ()
107+ collabs = set () # do we add "private" to this set?
103108 for team_access in self .roles .get ("team" , []):
104109 # note, if team information is missing from userinfo that means
105110 # the user is not a member of any collab
0 commit comments