feat(drive): prepare removal of user_id

this commit changes GET /api/<resources> to return resource caller has access to
    this is not anymmore resources users is owner of
This commit is contained in:
Edouard Vanbelle
2026-07-02 00:01:15 +02:00
parent 09339ea63f
commit 858139ef3b
18 changed files with 298 additions and 281 deletions
+5 -8
View File
@@ -915,17 +915,14 @@ impl AppServiceFactory {
/// repository — the data is the caller's Photos-scope geotagged photos
/// (§15: default personal drive + drives with
/// `include_in_photo_index = true` AND caller has Read).
/// `authorization` is used for the same subject expansion that
/// `photos_handler::list_photos` runs.
/// Group-membership expansion is inline in the SQL via
/// `storage.caller_group_ids`, so the service needs no AuthZ engine
/// handle.
pub fn create_places_service(
&self,
file_read: &Arc<FileBlobReadRepository>,
authorization: &Arc<crate::infrastructure::services::pg_acl_engine::PgAclEngine>,
) -> Arc<PlacesService> {
let service = Arc::new(PlacesService::new(
file_read.clone(),
authorization.clone(),
));
let service = Arc::new(PlacesService::new(file_read.clone()));
tracing::info!("Places service initialized");
service
}
@@ -1293,7 +1290,7 @@ impl AppServiceFactory {
apps.recent_service = Some(recent_service_eager.clone());
places_service = if core.config.features.enable_places {
Some(self.create_places_service(&repos.file_read_repository, &authorization))
Some(self.create_places_service(&repos.file_read_repository))
} else {
None
};
+4 -6
View File
@@ -274,10 +274,9 @@ impl FolderRepository for StubFolderStoragePort {
Ok(Vec::new())
}
async fn list_folders_by_owner(
async fn list_root_folders_for_caller(
&self,
_parent_id: Option<&str>,
_owner_id: Uuid,
_caller_id: Uuid,
) -> Result<Vec<Folder>, DomainError> {
Ok(Vec::new())
}
@@ -292,10 +291,9 @@ impl FolderRepository for StubFolderStoragePort {
Ok((Vec::new(), Some(0)))
}
async fn list_folders_by_owner_paginated(
async fn list_root_folders_for_caller_paginated(
&self,
_parent_id: Option<&str>,
_owner_id: Uuid,
_caller_id: Uuid,
_offset: usize,
_limit: usize,
_include_total: bool,