acl: Handle readonly buckets properly

master
Harshavardhana 9 years ago
parent ff59181527
commit e1a33deabf
  1. 6
      bucket-handlers.go
  2. 4
      object-handlers.go

@ -41,10 +41,8 @@ func (api CloudStorageAPI) ListMultipartUploadsHandler(w http.ResponseWriter, re
if !api.Anonymous {
if isRequestRequiresACLCheck(req) {
if api.Filesystem.IsPrivateBucket(bucket) {
writeErrorResponse(w, req, AccessDenied, req.URL.Path)
return
}
writeErrorResponse(w, req, AccessDenied, req.URL.Path)
return
}
}

@ -127,7 +127,7 @@ func (api CloudStorageAPI) PutObjectHandler(w http.ResponseWriter, req *http.Req
if !api.Anonymous {
if isRequestRequiresACLCheck(req) {
if api.Filesystem.IsPrivateBucket(bucket) {
if api.Filesystem.IsPrivateBucket(bucket) || api.Filesystem.IsReadOnlyBucket(bucket) {
writeErrorResponse(w, req, AccessDenied, req.URL.Path)
return
}
@ -512,7 +512,7 @@ func (api CloudStorageAPI) DeleteObjectHandler(w http.ResponseWriter, req *http.
if !api.Anonymous {
if isRequestRequiresACLCheck(req) {
if api.Filesystem.IsPrivateBucket(bucket) {
if api.Filesystem.IsPrivateBucket(bucket) || api.Filesystem.IsReadOnlyBucket(bucket) {
writeErrorResponse(w, req, AccessDenied, req.URL.Path)
return
}

Loading…
Cancel
Save