Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

add [properties-be] - extra protection against deleting system properties (#649)

Daniel Kweon4926540112ec
diff --git a/rust/cloud-storage/properties_service/src/api/properties/definitions/delete.rs b/rust/cloud-storage/properties_service/src/api/properties/definitions/delete.rs
index 7d38c37ccd..bf35e1d286 100644
--- a/rust/cloud-storage/properties_service/src/api/properties/definitions/delete.rs
+++ b/rust/cloud-storage/properties_service/src/api/properties/definitions/delete.rs
@@ -3,6 +3,7 @@ use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
+use system_properties::SystemPropertyKey;
use thiserror::Error;
use uuid::Uuid;
@@ -77,7 +78,7 @@ pub async fn delete_property_definition(
.await?
.ok_or(DeletePropertyDefinitionError::NotFound)?;
- if property.is_system {
+ if property.is_system || SystemPropertyKey::is_system_uuid(property_uuid) {
return Err(DeletePropertyDefinitionError::SystemPropertyNotModifiable);
}