Class RightAws::Sqs::Grantee
In: lib/sqs/right_sqs.rb
Parent: Object
RuntimeError AwsError AwsNoChange RightAWSParser RightErrorResponseParser RightHttp2xxParser AcfInterface SqsInterface SqsGen2Interface S3Interface Ec2 SdbInterface RightAwsBase ActiveSdbConnect ActiveSdb SqsGen2 S3 S3Generator Sqs RightDummyParser AWSErrorHandler AwsBenchmarkingBlock AwsUtils RightSaxParserCallback lib/sqs/right_sqs_interface.rb lib/sqs/right_sqs_gen2.rb lib/s3/right_s3.rb lib/acf/right_acf_interface.rb lib/sqs/right_sqs_gen2_interface.rb lib/sqs/right_sqs.rb lib/sdb/right_sdb_interface.rb lib/sdb/active_sdb.rb lib/ec2/right_ec2.rb lib/s3/right_s3_interface.rb lib/awsbase/right_awsbase.rb RightAwsBaseInterface VERSION RightAws dot/m_13_0.png

Methods

drop   grant   new   revoke  

Attributes

email  [RW] 
id  [RW] 
name  [RW] 
perms  [RW] 
queue  [RW] 

Public Class methods

Creates new Grantee instance. To create new grantee for queue use:

  grantee = Grantee.new(queue, grantee@email.address)
  grantee.grant('FULLCONTROL')

[Source]

     # File lib/sqs/right_sqs.rb, line 324
324:       def initialize(queue, email=nil, id=nil, name=nil, perms=[])
325:         @queue = queue
326:         @id    = id
327:         @name  = name
328:         @perms = perms
329:         @email = email
330:         retrieve unless id
331:       end

Public Instance methods

Revokes all permissions for this grantee. Returns true

[Source]

     # File lib/sqs/right_sqs.rb, line 377
377:       def drop
378:         @perms.each do |permission|
379:           @queue.sqs.interface.remove_grant(@queue.url, @email || @id, permission)
380:         end
381:         retrieve
382:         true
383:       end

Adds permissions for grantee. Permission: ‘FULLCONTROL’ | ‘RECEIVEMESSAGE’ | ‘SENDMESSAGE’. The caller must have set the email instance variable.

[Source]

     # File lib/sqs/right_sqs.rb, line 354
354:       def grant(permission=nil)
355:         raise "You can't grant permission without defining a grantee email address!" unless @email
356:         @queue.sqs.interface.add_grant(@queue.url, @email, permission)
357:         retrieve
358:       end

Revokes permissions for grantee. Permission: ‘FULLCONTROL’ | ‘RECEIVEMESSAGE’ | ‘SENDMESSAGE’. Default value is ‘FULLCONTROL’. User must have +@email+ or +@id+ set. Returns true.

[Source]

     # File lib/sqs/right_sqs.rb, line 365
365:       def revoke(permission='FULLCONTROL')
366:         @queue.sqs.interface.remove_grant(@queue.url, @email || @id, permission)
367:         unless @email   # if email is unknown - just remove permission from local perms list...
368:           @perms.delete(permission)
369:         else            # ... else retrieve updated information from Amazon
370:           retrieve
371:         end
372:         true
373:       end

[Validate]