diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-18 16:25:45 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-18 16:25:45 -0700 |
| commit | a0ab227e078987bf81551ff80586324fba6c7083 (patch) | |
| tree | 6d1f632ab710de4e0f3c94afd00158b90da5ddec /weed/s3api/s3api_object_retention.go | |
| parent | 2ad4a924be2a90a517c56eca6d87e94fed97c3fd (diff) | |
| download | seaweedfs-a0ab227e078987bf81551ff80586324fba6c7083.tar.xz seaweedfs-a0ab227e078987bf81551ff80586324fba6c7083.zip | |
fixes
Diffstat (limited to 'weed/s3api/s3api_object_retention.go')
| -rw-r--r-- | weed/s3api/s3api_object_retention.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/s3api/s3api_object_retention.go b/weed/s3api/s3api_object_retention.go index 10d2a6bba..d69a5f857 100644 --- a/weed/s3api/s3api_object_retention.go +++ b/weed/s3api/s3api_object_retention.go @@ -599,6 +599,15 @@ func (s3a *S3ApiServer) checkGovernanceBypassPermission(request *http.Request, b // checkObjectLockPermissions checks if an object can be deleted or modified func (s3a *S3ApiServer) checkObjectLockPermissions(request *http.Request, bucket, object, versionId string, bypassGovernance bool) error { + // For delete operations without versionId (which create delete markers), + // we should allow the operation even if the object is under retention. + // This is because delete markers are logical deletes, not physical deletes. + // Only block deletions when a specific versionId is provided. + if versionId == "" { + // This is a delete marker creation - allow it + return nil + } + // Get the object entry once to check both retention and legal hold entry, err := s3a.getObjectEntry(bucket, object, versionId) if err != nil { |
