db/python/tables/project.py
async def check_access_to_project_id(
        self, user: str, project_id: ProjectId, readonly: bool, raise_exception=True
    ) -> bool:
        """Check whether a user has access to project_id"""
        if self.allow_full_access:
            return True
        if not readonly:
            # validate write privileges here connection
            pass
        users = await self.get_allowed_users_for_project_id(
            project_id, readonly=readonly
        )
        has_access = users is None or user in users
        if not has_access and raise_exception:
            project_name = (await self.get_project_id_map())[project_id].name
            raise NoProjectAccess([project_name], readonly=readonly, author=user)
        return has_access
Check whether a user has access to project_id
Check whether a user has access to project_id
Check whether a user has access to project_id
async def check_access_to_project_id(
        self, user: str, project_id: ProjectId, readonly: bool, raise_exception=True
    ) -> bool:
        if self.allow_full_access:
            return True
        if not readonly:
            pass
        users = await self.get_allowed_users_for_project_id(
            project_id, readonly=readonly
        )
        has_access = users is None or user in users
        if not has_access and raise_exception:
            project_name = (await self.get_project_id_map())[project_id].name
            raise NoProjectAccess([project_name], readonly=readonly, author=user)
        return has_access
async def check_access_to_project_id ( self , user : str , project_id : ProjectId , readonly : bool , raise_exception = True ) -> bool : if self . allow_full_access : return True if not readonly : pass users = await self . get_allowed_users_for_project_id ( project_id , readonly = readonly ) has_access = users is None or user in users if not has_access and raise_exception : project_name = ( await self . get_project_id_map ( ) ) [ project_id ] . name raise NoProjectAccess ( [ project_name ] , readonly = readonly , author = user ) return has_access
Check whether a user has access to project_id
Check whether a user has access to project_id
"""Check whether a user has access to project_id""" # validate write privileges here connection
self
user
str
project_id
ProjectId
readonly
bool
raise_exception