Class: Aliyun::STS::Policy
- Inherits:
-
Common::Struct::Base
- Object
- Common::Struct::Base
- Aliyun::STS::Policy
- Defined in:
- lib/aliyun/sts/struct.rb
Overview
STS Policy. Referer to help.aliyun.com/document_detail/ram/ram-user-guide/policy_reference/struct_def.html for details.
Constant Summary collapse
- VERSION =
'1'
Instance Method Summary collapse
-
#allow(actions, resources) ⇒ Object
Add an ‘Allow’ rule.
-
#deny(actions, resources) ⇒ Object
Add an ‘Deny’ rule.
-
#serialize ⇒ Object
Serialize to rule to string.
Methods inherited from Common::Struct::Base
Methods included from Common::Struct::Base::AttrHelper
Constructor Details
This class inherits a constructor from Aliyun::Common::Struct::Base
Instance Method Details
#allow(actions, resources) ⇒ Object
Add an ‘Allow’ rule
21 22 23 |
# File 'lib/aliyun/sts/struct.rb', line 21 def allow(actions, resources) add_rule(true, actions, resources) end |
#deny(actions, resources) ⇒ Object
Add an ‘Deny’ rule
30 31 32 |
# File 'lib/aliyun/sts/struct.rb', line 30 def deny(actions, resources) add_rule(false, actions, resources) end |
#serialize ⇒ Object
Serialize to rule to string
35 36 37 |
# File 'lib/aliyun/sts/struct.rb', line 35 def serialize {'Version' => VERSION, 'Statement' => @rules}.to_json end |