2010-09-18 13:40:48 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
module Google
|
2010-09-18 13:40:48 -04:00
|
|
|
|
|
|
|
class AccessControlList < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@grant = { 'Grantee' => {} }
|
|
|
|
@response = { 'BucketLoggingStatus' => {} }
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'DisplayName', 'ID'
|
|
|
|
if @in_access_control_list
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant['Grantee'][name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
else
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['Owner'][name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
|
|
|
when 'Grant'
|
|
|
|
@response['BucketLoggingStatus']['LoggingEnabled']['TargetGrants'] << @grant
|
|
|
|
@grant = { 'Grantee' => {} }
|
|
|
|
when 'LoggingEnabled'
|
|
|
|
@response['BucketLoggingStatus']['LoggingEnabled'] = { 'TargetGrants' => [] }
|
|
|
|
when 'Permission'
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant[name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
when 'TargetBucket', 'TargetPrefix'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['BucketLoggingStatus'][name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
when 'URI'
|
2011-05-12 16:15:13 -04:00
|
|
|
@grant['Grantee'][name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|