def cloneObject(user, sourceBucket, sourceKey, destBucket, destKey, metadata, ifMatch, ifNotMatch, ifModifiedSince, ifNotModifiedSince, accessControlPolicy): if not ( ObjectACP.checkUserPermission(user, sourceBucket, sourceKey, 'read') and ObjectACP.checkUserPermission(user, destBucket, destKey, 'write') ): raise ForbiddenException.AccessDeniedException() res = Object.cloneObject(user, sourceBucket, sourceKey, destBucket, destKey, metadata, ifMatch, ifNotMatch, ifModifiedSince, ifNotModifiedSince) ObjectACP.setObjectACP(destBucket, destKey, accessControlPolicy) BucketLogging.logKeyEvent(user, sourceBucket, sourceKey, 'get') BucketLogging.logKeyEvent(user, destBucket, destKey, 'set', res[2]) return res