Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

remove debug

Chris Lu35ad7d08a5a0
diff --git a/weed/s3api/s3tables/permissions.go b/weed/s3api/s3tables/permissions.go
index 8521d6443e..0db52b6022 100644
--- a/weed/s3api/s3tables/permissions.go
+++ b/weed/s3api/s3tables/permissions.go
@@ -118,30 +118,21 @@ func CheckPermissionWithContext(operation, principal, owner, resourcePolicy, res
}
func checkPermission(operation, principal, owner, resourcePolicy, resourceARN string, ctx *PolicyContext) bool {
- fmt.Printf("DEBUG: checkPermission op=%s princ=%s owner=%s policyLen=%d defaultAllow=%v\n",
- operation, principal, owner, len(resourcePolicy), ctx != nil && ctx.DefaultAllow)
- if resourcePolicy != "" {
- fmt.Printf("DEBUG: policy content: %s\n", resourcePolicy)
- }
// Owner always has permission
if principal == owner {
- fmt.Printf("DEBUG: Allowed by Owner check\n")
return true
}
if hasIdentityPermission(operation, ctx) {
- fmt.Printf("DEBUG: Allowed by Identity check\n")
return true
}
// If no policy is provided, use default allow if enabled
if resourcePolicy == "" {
if ctx != nil && ctx.DefaultAllow {
- fmt.Printf("DEBUG: Allowed by DefaultAllow\n")
return true
}
- fmt.Printf("DEBUG: Denied by DefaultAllow=false (no policy)\n")
return false
}
@@ -183,9 +174,10 @@ func checkPermission(operation, principal, owner, resourcePolicy, resourceARN st
}
// Statement matches - check effect
- if stmt.Effect == "Allow" {
+ switch stmt.Effect {
+ case "Allow":
hasAllow = true
- } else if stmt.Effect == "Deny" {
+ case "Deny":
// Explicit deny always wins
return false
}