Class: AWS::Policy::Statement
- Inherits:
-
Object
- Object
- AWS::Policy::Statement
- Defined in:
- lib/aws/policy.rb,
lib/aws/policy.rb
Overview
Represents a statement in a policy.
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.
-
#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.
746 747 748 749 750 751 752 753 |
# File 'lib/aws/policy.rb', line 746 def initialize(opts = {}) self.sid = UUIDTools::UUID..to_s 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.
702 703 704 |
# File 'lib/aws/policy.rb', line 702 def actions @actions end |
#conditions ⇒ Array
Returns an array of conditions for this policy.
713 714 715 |
# File 'lib/aws/policy.rb', line 713 def conditions @conditions end |
#effect ⇒ String
Returns the statement effect, either “Allow” or “Deny”
695 696 697 |
# File 'lib/aws/policy.rb', line 695 def effect @effect end |
#excluded_actions ⇒ Array
Returns an array of actions excluded by this policy statement.
706 707 708 |
# File 'lib/aws/policy.rb', line 706 def excluded_actions @excluded_actions end |
#principals ⇒ Array
Returns an array of principals.
698 699 700 |
# File 'lib/aws/policy.rb', line 698 def principals @principals end |
#resources ⇒ Array
Returns an array of resources affected by this policy statement.
710 711 712 |
# File 'lib/aws/policy.rb', line 710 def resources @resources end |
#sid ⇒ String
Returns the statement id
691 692 693 |
# File 'lib/aws/policy.rb', line 691 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.
765 766 767 768 |
# File 'lib/aws/policy.rb', line 765 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.
757 758 759 760 |
# File 'lib/aws/policy.rb', line 757 def include_actions(*actions) self.actions ||= [] self.actions.push(*actions) end |