|
|
@ -65,19 +65,13 @@ func (s3a *S3ApiServer) ListBucketsHandler(w http.ResponseWriter, r *http.Reques |
|
|
for _, entry := range entries { |
|
|
for _, entry := range entries { |
|
|
if entry.IsDirectory { |
|
|
if entry.IsDirectory { |
|
|
// Check ownership: only show buckets owned by this user (unless admin)
|
|
|
// Check ownership: only show buckets owned by this user (unless admin)
|
|
|
if identity != nil && identityId != "" { |
|
|
|
|
|
var bucketOwnerId string |
|
|
|
|
|
if entry.Extended != nil { |
|
|
|
|
|
|
|
|
if identity != nil && identityId != "" && !identity.isAdmin() { |
|
|
if id, ok := entry.Extended[s3_constants.AmzIdentityId]; ok { |
|
|
if id, ok := entry.Extended[s3_constants.AmzIdentityId]; ok { |
|
|
bucketOwnerId = string(id) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Skip buckets not owned by this user (unless they're an admin)
|
|
|
|
|
|
if bucketOwnerId != "" && bucketOwnerId != identityId && !identity.isAdmin() { |
|
|
|
|
|
|
|
|
if bucketOwnerId := string(id); bucketOwnerId != "" && bucketOwnerId != identityId { |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Check permissions for each bucket
|
|
|
// Check permissions for each bucket
|
|
|
if identity != nil { |
|
|
if identity != nil { |
|
|
|