mirror of https://github.com/buster-so/buster.git
collections fix
This commit is contained in:
parent
5e3f67eb7d
commit
4c30dc3cca
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue