Example #1
0
def setObject(user, bucket, key, metadata, data, contentMd5, contentType, contentDisposition, contentEncoding, accessControlPolicy):
	if not ObjectACP.checkUserPermission(user, bucket, key, 'write'):
		raise ForbiddenException.AccessDeniedException()
	res = Object.setObject(userid = user, bucket=bucket, key=key, metadata=metadata, data=data, content_md5 = contentMd5, content_type=contentType, content_disposition=contentDisposition, content_encoding=contentEncoding)
	ObjectACP.setObjectACP(bucket, key, accessControlPolicy)
	BucketLogging.logKeyEvent(user, bucket, key, 'set', res[2])
	return res
Example #2
0
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
Example #3
0
def setObjectACP(user, bucket, key, accessControlPolicy):
	if not ObjectACP.checkUserPermission(user, bucket, key, 'write_acp'):
		raise ForbiddenException.AccessDeniedException()
	ObjectACP.setObjectACP(bucket, key, accessControlPolicy)
	BucketLogging.logKeyEvent(user, bucket, key, 'set_acp')