@ -1159,8 +1159,8 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
srcInfo . UserDefined = filterReplicationStatusMetadata ( srcInfo . UserDefined )
srcInfo . UserDefined = filterReplicationStatusMetadata ( srcInfo . UserDefined )
srcInfo . UserDefined = objectlock . FilterObjectLockMetadata ( srcInfo . UserDefined , true , true )
srcInfo . UserDefined = objectlock . FilterObjectLockMetadata ( srcInfo . UserDefined , true , true )
retPerms := isPutActionAllowed ( getRequestAuthType ( r ) , dstBucket , dstObject , r , iampolicy . PutObjectRetentionAction )
retPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , dstBucket , dstObject , r , iampolicy . PutObjectRetentionAction )
holdPerms := isPutActionAllowed ( getRequestAuthType ( r ) , dstBucket , dstObject , r , iampolicy . PutObjectLegalHoldAction )
holdPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , dstBucket , dstObject , r , iampolicy . PutObjectLegalHoldAction )
getObjectInfo := objectAPI . GetObjectInfo
getObjectInfo := objectAPI . GetObjectInfo
if api . CacheAPI ( ) != nil {
if api . CacheAPI ( ) != nil {
@ -1403,7 +1403,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
reader = r . Body
reader = r . Body
// Check if put is allowed
// Check if put is allowed
if s3Err = isPutActionAllowed ( rAuthType , bucket , object , r , iampolicy . PutObjectAction ) ; s3Err != ErrNone {
if s3Err = isPutActionAllowed ( ctx , rAuthType , bucket , object , r , iampolicy . PutObjectAction ) ; s3Err != ErrNone {
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Err ) , r . URL , guessIsBrowserReq ( r ) )
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Err ) , r . URL , guessIsBrowserReq ( r ) )
return
return
}
}
@ -1488,8 +1488,8 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
putObject = api . CacheAPI ( ) . PutObject
putObject = api . CacheAPI ( ) . PutObject
}
}
retPerms := isPutActionAllowed ( getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectRetentionAction )
retPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectRetentionAction )
holdPerms := isPutActionAllowed ( getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectLegalHoldAction )
holdPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectLegalHoldAction )
getObjectInfo := objectAPI . GetObjectInfo
getObjectInfo := objectAPI . GetObjectInfo
if api . CacheAPI ( ) != nil {
if api . CacheAPI ( ) != nil {
@ -1512,7 +1512,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
metadata [ xhttp . AmzBucketReplicationStatus ] = replication . Pending . String ( )
metadata [ xhttp . AmzBucketReplicationStatus ] = replication . Pending . String ( )
}
}
if r . Header . Get ( xhttp . AmzBucketReplicationStatus ) == replication . Replica . String ( ) {
if r . Header . Get ( xhttp . AmzBucketReplicationStatus ) == replication . Replica . String ( ) {
if s3Err = isPutActionAllowed ( getRequestAuthType ( r ) , bucket , object , r , iampolicy . ReplicateObjectAction ) ; s3Err != ErrNone {
if s3Err = isPutActionAllowed ( ctx , getRequestAuthType ( r ) , bucket , object , r , iampolicy . ReplicateObjectAction ) ; s3Err != ErrNone {
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Err ) , r . URL , guessIsBrowserReq ( r ) )
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Err ) , r . URL , guessIsBrowserReq ( r ) )
return
return
}
}
@ -1668,8 +1668,8 @@ func (api objectAPIHandlers) NewMultipartUploadHandler(w http.ResponseWriter, r
return
return
}
}
retPerms := isPutActionAllowed ( getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectRetentionAction )
retPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectRetentionAction )
holdPerms := isPutActionAllowed ( getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectLegalHoldAction )
holdPerms := isPutActionAllowed ( ctx , getRequestAuthType ( r ) , bucket , object , r , iampolicy . PutObjectLegalHoldAction )
getObjectInfo := objectAPI . GetObjectInfo
getObjectInfo := objectAPI . GetObjectInfo
if api . CacheAPI ( ) != nil {
if api . CacheAPI ( ) != nil {
@ -2134,7 +2134,7 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http
s3Error APIErrorCode
s3Error APIErrorCode
)
)
reader = r . Body
reader = r . Body
if s3Error = isPutActionAllowed ( rAuthType , bucket , object , r , iampolicy . PutObjectAction ) ; s3Error != ErrNone {
if s3Error = isPutActionAllowed ( ctx , rAuthType , bucket , object , r , iampolicy . PutObjectAction ) ; s3Error != ErrNone {
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Error ) , r . URL , guessIsBrowserReq ( r ) )
writeErrorResponse ( ctx , w , errorCodes . ToAPIErr ( s3Error ) , r . URL , guessIsBrowserReq ( r ) )
return
return
}
}