You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::Core::Policy::Statement
- Inherits:
-
Object
- Object
- AWS::Core::Policy::Statement
- Defined in:
- lib/aws/core/policy.rb,
lib/aws/core/policy.rb
Overview
Represents a statement in a policy.
Direct Known Subclasses
IAM::Policy::Statement, S3::Policy::Statement, SNS::Policy::Statement, SQS::Policy::Statement
Instance Attribute Summary collapse
-
#actions ⇒ Array
Returns an array of statement actions included by this policy statement.
-
#conditions ⇒ Array
Returns an array of conditions for this policy.
-
#effect ⇒ String
Returns the statement effect, either "Allow" or "Deny".
-
#excluded_actions ⇒ Array
Returns an array of actions excluded by this policy statement.
-
#excluded_resources ⇒ Object
Returns the value of attribute excluded_resources.
-
#principals ⇒ Array
Returns an array of principals.
-
#resources ⇒ Array
Returns an array of resources affected by this policy statement.
-
#sid ⇒ String
Returns the statement id.
Instance Method Summary collapse
-
#exclude_actions(*actions) ⇒ Object
(also: #exclude_action)
Convenience method to add to the list of actions explicitly not affected by this statement.
-
#include_actions(*actions) ⇒ Object
(also: #include_action)
Convenience method to add to the list of actions affected by this statement.
-
#initialize(opts = {}) {|_self| ... } ⇒ Statement
constructor
Constructs a new statement.
Constructor Details
#initialize(opts = {}) {|_self| ... } ⇒ Statement
Constructs a new statement.
749 750 751 752 753 754 755 756 |
# File 'lib/aws/core/policy.rb', line 749 def initialize(opts = {}) self.sid = SecureRandom.uuid.tr('-','') self.conditions = ConditionBlock.new (opts) yield(self) if block_given? end |
Instance Attribute Details
#actions ⇒ Array
Returns an array of statement actions included by this policy statement.
703 704 705 |
# File 'lib/aws/core/policy.rb', line 703 def actions @actions end |
#conditions ⇒ Array
Returns an array of conditions for this policy.
714 715 716 |
# File 'lib/aws/core/policy.rb', line 714 def conditions @conditions end |
#effect ⇒ String
Returns the statement effect, either "Allow" or "Deny"
696 697 698 |
# File 'lib/aws/core/policy.rb', line 696 def effect @effect end |
#excluded_actions ⇒ Array
Returns an array of actions excluded by this policy statement.
707 708 709 |
# File 'lib/aws/core/policy.rb', line 707 def excluded_actions @excluded_actions end |
#excluded_resources ⇒ Object
Returns the value of attribute excluded_resources
716 717 718 |
# File 'lib/aws/core/policy.rb', line 716 def excluded_resources @excluded_resources end |
#principals ⇒ Array
Returns an array of principals.
699 700 701 |
# File 'lib/aws/core/policy.rb', line 699 def principals @principals end |
#resources ⇒ Array
Returns an array of resources affected by this policy statement.
711 712 713 |
# File 'lib/aws/core/policy.rb', line 711 def resources @resources end |
#sid ⇒ String
Returns the statement id
692 693 694 |
# File 'lib/aws/core/policy.rb', line 692 def sid @sid end |
Instance Method Details
#exclude_actions(*actions) ⇒ Object Also known as: exclude_action
Convenience method to add to the list of actions explicitly not affected by this statement.
768 769 770 771 |
# File 'lib/aws/core/policy.rb', line 768 def exclude_actions(*actions) self.excluded_actions ||= [] self.excluded_actions.push(*actions) end |
#include_actions(*actions) ⇒ Object Also known as: include_action
Convenience method to add to the list of actions affected by this statement.
760 761 762 763 |
# File 'lib/aws/core/policy.rb', line 760 def include_actions(*actions) self.actions ||= [] self.actions.push(*actions) end |