diff --git a/api/libs/handlers/src/collections/add_assets_to_collection_handler.rs b/api/libs/handlers/src/collections/add_assets_to_collection_handler.rs index adf7e9a5c..392e8aff3 100644 --- a/api/libs/handlers/src/collections/add_assets_to_collection_handler.rs +++ b/api/libs/handlers/src/collections/add_assets_to_collection_handler.rs @@ -162,7 +162,12 @@ pub async fn add_assets_to_collection_handler( // Check if user has access to the dashboard let has_dashboard_permission = check_permission_access( dashboard.permission, - &[AssetPermissionRole::CanView], + &[ + AssetPermissionRole::CanView, + AssetPermissionRole::CanEdit, + AssetPermissionRole::FullAccess, + AssetPermissionRole::Owner, + ], dashboard.dashboard_file.organization_id, &user.organizations, ); @@ -314,7 +319,12 @@ pub async fn add_assets_to_collection_handler( // Check if user has access to the metric let has_metric_permission = check_permission_access( metric.permission, - &[AssetPermissionRole::CanView], + &[ + AssetPermissionRole::CanView, + AssetPermissionRole::CanEdit, + AssetPermissionRole::FullAccess, + AssetPermissionRole::Owner, + ], metric.metric_file.organization_id, &user.organizations, ); diff --git a/api/libs/handlers/src/collections/get_collection_handler.rs b/api/libs/handlers/src/collections/get_collection_handler.rs index abf51b00b..0ccd73e67 100644 --- a/api/libs/handlers/src/collections/get_collection_handler.rs +++ b/api/libs/handlers/src/collections/get_collection_handler.rs @@ -27,7 +27,7 @@ struct AssetPermissionInfo { } /// Type for querying asset data from database -#[derive(Queryable, Clone)] +#[derive(Queryable, Clone, Debug)] struct AssetQueryResult { id: Uuid, name: String, @@ -222,6 +222,8 @@ pub async fn get_collection_handler( } }; + println!("dashboard_assets: {:?}", dashboard_assets); + // Combine all assets let all_assets = [metric_assets, dashboard_assets].concat(); let formatted_assets = format_assets(all_assets);