예제 #1
0
def setBucketLogStatus(user, srcBucket, logBucket):
	if not BucketACP.checkUserPermission(user, bucket, 'write_log_status'):
		raise ForbiddenException.AccessDeniedException()
	if not BucketACP.checkUserPermission(user, bucket, 'write'):
		raise ForbiddenException.AccessDeniedException()
	BucketLogging.logBucketEvent(user, bucket, 'set_log_status')
	return BucketLogging.setBucketLogStatus(srcBucket, logBucket)
예제 #2
0
def setBucket(user, bucket, accessControlPolicy):
	if not user:
		raise ForbiddenException.AccessDeniedException()
	try:
		Bucket.setBucket(userid = user, bucket = bucket)
	except ConflictException.BucketAlreadyOwnedByYouException:
		pass
	BucketLogging.logBucketEvent(user, bucket, 'set')
	BucketACP.setBucketACP(bucket, accessControlPolicy)
	BucketLogging.logBucketEvent(user, bucket, 'set_acp')
예제 #3
0
def getBucket(user, bucket, prefix, marker, maxKeys, delimiter):
	if not BucketACP.checkUserPermission(user, bucket, 'read'):
		raise ForbiddenException.AccessDeniedException()
	BucketLogging.logBucketEvent(user, bucket, 'get')
	return Bucket.getBucket(bucket=bucket, prefix=prefix, marker=marker, maxKeys=maxKeys, delimiter=delimiter)
예제 #4
0
def getBucketLogStatus(user, bucket):
	if not BucketACP.checkUserPermission(user, bucket, 'read_log_status'):
		raise ForbiddenException.AccessDeniedException()
	BucketLogging.logBucketEvent(user, bucket, 'get_log_status')
	return BucketLogging.getBucketLogStatus(bucket)
예제 #5
0
def setBucketACP(user, bucket, accessControlPolicy):
	if not BucketACP.checkUserPermission(user, bucket, 'write_acp'):
		raise ForbiddenException.AccessDeniedException()
	BucketACP.setBucketACP(bucket, accessControlPolicy)
	BucketLogging.logBucketEvent(user, bucket, 'set_acp')
예제 #6
0
def destroyBucket(user, bucket):
	if not BucketACP.checkUserPermission(user, bucket, 'destroy'):
		raise ForbiddenException.AccessDeniedException()
	Bucket.destroyBucket(bucket)
	BucketLogging.logBucketEvent(user, bucket, 'delete')