class AWS::S3::AccessControlList::Grantee

Represents a user who is granted some kind of permission through a Grant. There are three ways to specify a grantee:

When constructing a grantee, you must provide a value for exactly one of the following attributes:

@attr [String] amazon_customer_email The e-mail address of

an AWS customer.

@attr [String] canonical_user_id The canonical user ID of an

AWS customer.

@attr [String] group_uri A URI that identifies a particular

group of users.

@attr [String] display_name The display name associated with

the grantee.  This is provided by S3 when reading an ACL.

Constants

SIGNAL_ATTRIBUTES

Public Instance Methods

signal_attribute() click to toggle source

@private

# File lib/aws/s3/access_control_list.rb, line 130
def signal_attribute
  SIGNAL_ATTRIBUTES.find { |att| send(att) }
end
stag() click to toggle source

@private

# File lib/aws/s3/access_control_list.rb, line 120
def stag
  if attr = signal_attribute
    super + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
      " xsi:type=\"#{type_for_attr(attr)}\""
  else
    super
  end
end
type_for_attr(attr) click to toggle source

@private

# File lib/aws/s3/access_control_list.rb, line 135
def type_for_attr(attr)
  { :amazon_customer_email => "AmazonCustomerByEmail",
    :canonical_user_id => "CanonicalUser",
    :group_uri => "Group" }[attr]
end
validate!() click to toggle source

(see AWS::S3::ACLObject#validate!)

# File lib/aws/s3/access_control_list.rb, line 111
def validate!
  attr = signal_attribute
  raise "missing amazon_customer_email, canonical_user_id, "+
    "or group_uri" unless attr
  raise "display_name is invalid with #{attr}" if
    attr != :canonical_user_id and display_name
end