last few changes

This commit is contained in:
dal 2025-03-06 16:52:14 -07:00
parent 95e3dcfe80
commit a1f5fe6e2a
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
6 changed files with 15 additions and 0 deletions

View File

@ -256,6 +256,7 @@ pub async fn get_user_collection_permission(
AssetPermissionRole::Owner => 3,
AssetPermissionRole::Editor => 2,
AssetPermissionRole::Viewer => 1,
_ => 0,
})
.ok_or_else(|| anyhow!("No collection found with permissions"))?;
@ -376,6 +377,7 @@ async fn get_collection_and_check_permissions(
AssetPermissionRole::Owner => 3,
AssetPermissionRole::Editor => 2,
AssetPermissionRole::Viewer => 1,
_ => 0,
})
.ok_or_else(|| anyhow!("No collection found with permissions"))?;

View File

@ -283,6 +283,7 @@ pub async fn get_user_dashboard_permission(
AssetPermissionRole::Owner => 3,
AssetPermissionRole::Editor => 2,
AssetPermissionRole::Viewer => 1,
_ => 0,
})
.ok_or_else(|| anyhow!("No dashboard found with permissions"))?;

View File

@ -221,6 +221,7 @@ pub async fn get_user_thread_permission(
AssetPermissionRole::Owner => 3,
AssetPermissionRole::Editor => 2,
AssetPermissionRole::Viewer => 1,
_ => 0,
})
.ok_or_else(|| anyhow!("No thread found with permissions"))?;

View File

@ -430,6 +430,7 @@ pub async fn get_user_thread_permission(
AssetPermissionRole::Owner => 3,
AssetPermissionRole::Editor => 2,
AssetPermissionRole::Viewer => 1,
_ => 0,
})
.ok_or_else(|| anyhow!("No thread found with permissions"))?;

View File

@ -158,6 +158,7 @@ pub async fn list_user_favorites(user: &AuthenticatedUser) -> Result<Vec<Favorit
favorites.push(FavoriteEnum::Object(thread.clone()));
}
}
_ => {}
}
}

View File

@ -614,6 +614,12 @@ fn create_invitation_email_type(
thread_name: asset_name,
thread_id: asset_id,
}),
_ => EmailType::ThreadInvite(ThreadInvite {
inviter_name,
new_user,
thread_name: asset_name,
thread_id: asset_id,
}),
};
email_type
@ -673,6 +679,9 @@ async fn get_asset_name(asset_id: Arc<Uuid>, asset_type: AssetType) -> Result<St
}
}
}
AssetType::Chat => {
return Err(anyhow!("Public access is not supported for chats yet"));
}
};
Ok(name)