From 35ad7d08a5a03e489932438e6f656a2dff478048 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 16 Feb 2026 14:03:02 -0800 Subject: [PATCH] remove debug --- weed/s3api/s3tables/permissions.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/weed/s3api/s3tables/permissions.go b/weed/s3api/s3tables/permissions.go index 8521d6443..0db52b602 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 }