4040 UploadLinks ,
4141)
4242from ...services .service_exception_handling import DEFAULT_BACKEND_SERVICE_STATUS_CODES
43- from ...services .storage import (
44- AccessRight ,
45- StorageApi ,
46- StorageFileMetaData ,
47- to_file_api_model ,
48- )
43+ from ...services .storage import StorageApi , StorageFileMetaData , to_file_api_model
4944from ..dependencies .authentication import get_current_user_id
5045from ..dependencies .services import get_api_client
5146from ._common import API_SERVER_DEV_FEATURES_ENABLED
@@ -73,16 +68,16 @@ async def _get_file(
7368 file_id : UUID ,
7469 storage_client : StorageApi ,
7570 user_id : int ,
76- access_right : AccessRight ,
7771):
7872 """Gets metadata for a given file resource"""
7973
8074 try :
81- stored_files : list [StorageFileMetaData ] = await storage_client .search_files (
75+ stored_files : list [
76+ StorageFileMetaData
77+ ] = await storage_client .search_owned_files (
8278 user_id = user_id ,
8379 file_id = file_id ,
8480 sha256_checksum = None ,
85- access_right = access_right ,
8681 )
8782 if not stored_files :
8883 msg = "Not found in storage"
@@ -289,7 +284,6 @@ async def get_file(
289284 file_id = file_id ,
290285 storage_client = storage_client ,
291286 user_id = user_id ,
292- access_right = "read" ,
293287 )
294288
295289
@@ -307,11 +301,10 @@ async def search_files_page(
307301 file_id : UUID | None = None ,
308302):
309303 """Search files"""
310- stored_files : list [StorageFileMetaData ] = await storage_client .search_files (
304+ stored_files : list [StorageFileMetaData ] = await storage_client .search_owned_files (
311305 user_id = user_id ,
312306 file_id = file_id ,
313307 sha256_checksum = sha256_checksum ,
314- access_right = "read" ,
315308 )
316309 if page_params .offset > len (stored_files ):
317310 _logger .debug ("File with sha256_checksum=%d not found." , sha256_checksum )
@@ -342,7 +335,6 @@ async def delete_file(
342335 file_id = file_id ,
343336 storage_client = storage_client ,
344337 user_id = user_id ,
345- access_right = "write" ,
346338 )
347339 await storage_client .delete_file (
348340 user_id = user_id , quoted_storage_file_id = file .quoted_storage_file_id
0 commit comments