mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Stops listing objects for write-only access (#6396)
This commit is contained in:
parent
8690d62146
commit
882a1a1ccc
@ -328,12 +328,16 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
|
|||||||
return toJSONError(authErr)
|
return toJSONError(authErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error out anonymous (non-owner) has no access download or upload objects.
|
reply.Writable = writable
|
||||||
if !readable && !writable {
|
if !readable {
|
||||||
return errAuthentication
|
// Error out if anonymous user (non-owner) has no access to download or upload objects
|
||||||
|
if !writable {
|
||||||
|
return errAuthentication
|
||||||
|
}
|
||||||
|
// return empty object list if access is write only
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.Writable = writable
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lo, err := listObjects(context.Background(), args.BucketName, args.Prefix, args.Marker, slashSeparator, 1000)
|
lo, err := listObjects(context.Background(), args.BucketName, args.Prefix, args.Marker, slashSeparator, 1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user