Add download set check

This commit is contained in:
Jai A
2022-03-27 19:14:39 -07:00
parent d1c0c9739d
commit a49dc04f5d

View File

@@ -450,6 +450,13 @@ pub async fn version_edit(
}
if let Some(downloads) = &new_version.downloads {
if !user.role.is_mod() {
return Err(ApiError::CustomAuthentication(
"You don't have permission to set the downloads of this mod"
.to_string(),
));
}
sqlx::query!(
"
UPDATE versions