# HG changeset patch # User Sebastien Jodogne # Date 1700824323 -3600 # Node ID 912565317b9ada8ce0d8363f23517d460f9097e0 # Parent b853a63e9830c99942b152adbe1d2ff84d919032 plugins are now allowed to modify/delete private metadata/attachments diff -r b853a63e9830 -r 912565317b9a NEWS --- a/NEWS Fri Nov 24 11:53:23 2023 +0100 +++ b/NEWS Fri Nov 24 12:12:03 2023 +0100 @@ -50,6 +50,13 @@ - added 'orthanc_storage_cache_count' and 'orthanc_storage_cache_size_mb' +Plugins +------- + +* Plugins are now allowed to modify/delete private metadata/attachments + (i.e. whose identifiers are < 1024) + + Maintenance ----------- diff -r b853a63e9830 -r 912565317b9a OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Nov 24 11:53:23 2023 +0100 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Nov 24 12:12:03 2023 +0100 @@ -1912,7 +1912,8 @@ std::string name = call.GetUriComponent("name", ""); MetadataType metadata = StringToMetadata(name); - if (IsUserMetadata(metadata)) // It is forbidden to modify internal metadata + if (IsUserMetadata(metadata) || // It is forbidden to delete internal metadata... + call.GetRequestOrigin() == RequestOrigin_Plugins) // ...except for plugins { bool found; int64_t revision; @@ -1978,7 +1979,8 @@ std::string value; call.BodyToString(value); - if (IsUserMetadata(metadata)) // It is forbidden to modify internal metadata + if (IsUserMetadata(metadata) || // It is forbidden to modify internal metadata... + call.GetRequestOrigin() == RequestOrigin_Plugins) // ...except for plugins { int64_t oldRevision; std::string oldMD5; @@ -2574,7 +2576,8 @@ std::string name = call.GetUriComponent("name", ""); FileContentType contentType = StringToContentType(name); - if (IsUserContentType(contentType)) // It is forbidden to modify internal attachments + if (IsUserContentType(contentType) || // It is forbidden to modify internal attachments... + call.GetRequestOrigin() == RequestOrigin_Plugins) // ...except for plugins { int64_t oldRevision; std::string oldMD5; @@ -2633,7 +2636,8 @@ FileContentType contentType = StringToContentType(name); bool allowed; - if (IsUserContentType(contentType)) + if (IsUserContentType(contentType) || // It is forbidden to delete internal attachments... + call.GetRequestOrigin() == RequestOrigin_Plugins) // ...except for plugins { allowed = true; }