|
@ -358,3 +358,22 @@ func (s3a *S3ApiServer) checkAccessForWriteObject(r *http.Request, bucket, objec |
|
|
func getObjectEntry(s3a *S3ApiServer, bucket, object string) (*filer_pb.Entry, error) { |
|
|
func getObjectEntry(s3a *S3ApiServer, bucket, object string) (*filer_pb.Entry, error) { |
|
|
return s3a.getEntry(util.Join(s3a.option.BucketsPath, bucket), object) |
|
|
return s3a.getEntry(util.Join(s3a.option.BucketsPath, bucket), object) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (s3a *S3ApiServer) ExtractBucketAcp(r *http.Request) (owner string, grants []*s3.Grant, errCode s3err.ErrorCode) { |
|
|
|
|
|
accountId := s3acl.GetAccountId(r) |
|
|
|
|
|
|
|
|
|
|
|
ownership := s3_constants.DefaultOwnershipForCreate |
|
|
|
|
|
if ownership == s3_constants.OwnershipBucketOwnerEnforced { |
|
|
|
|
|
return accountId, []*s3.Grant{ |
|
|
|
|
|
{ |
|
|
|
|
|
Permission: &s3_constants.PermissionFullControl, |
|
|
|
|
|
Grantee: &s3.Grantee{ |
|
|
|
|
|
Type: &s3_constants.GrantTypeCanonicalUser, |
|
|
|
|
|
ID: &accountId, |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
}, s3err.ErrNone |
|
|
|
|
|
} else { |
|
|
|
|
|
return s3acl.ParseAndValidateAclHeadersOrElseDefault(r, s3a.accountManager, ownership, accountId, accountId, false) |
|
|
|
|
|
} |
|
|
|
|
|
} |