Class: InstanceAgent::Plugins::CodeDeployPlugin::ApplicationSpecification::AclInfo
- Inherits:
-
Object
- Object
- InstanceAgent::Plugins::CodeDeployPlugin::ApplicationSpecification::AclInfo
- Defined in:
- lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb
Overview
Helper Class for storing an acl
Instance Attribute Summary collapse
-
#aces ⇒ Object
readonly
Returns the value of attribute aces.
-
#additional ⇒ Object
readonly
Returns the value of attribute additional.
Instance Method Summary collapse
- #add_ace(ace) ⇒ Object
- #clear_additional ⇒ Object
-
#get_acl ⇒ Object
format array of aces with format: [default:]:[name]:(r|-)(w|-)(x|-).
-
#get_default_ace ⇒ Object
format [default:]:[name]:(r|-)(w|-)(x|-) (or nil if none present).
-
#get_default_group_ace ⇒ Object
format [default:]:[name]:(r|-)(w|-)(x|-) (or nil if not present).
- #has_base_mask? ⇒ Boolean
- #has_base_named? ⇒ Boolean
- #has_default? ⇒ Boolean
- #has_default_group? ⇒ Boolean
- #has_default_mask? ⇒ Boolean
- #has_default_named? ⇒ Boolean
- #has_default_other? ⇒ Boolean
- #has_default_user? ⇒ Boolean
-
#initialize(acl) ⇒ AclInfo
constructor
A new instance of AclInfo.
Constructor Details
Instance Attribute Details
#aces ⇒ Object (readonly)
Returns the value of attribute aces.
8 9 10 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 8 def aces @aces end |
#additional ⇒ Object (readonly)
Returns the value of attribute additional.
8 9 10 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 8 def additional @additional end |
Instance Method Details
#add_ace(ace) ⇒ Object
44 45 46 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 44 def add_ace(ace) additional << AceInfo.new(ace, true) end |
#clear_additional ⇒ Object
48 49 50 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 48 def clear_additional() additional = [] end |
#get_acl ⇒ Object
format array of aces with format: [default:]:[name]:(r|-)(w|-)(x|-)
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 33 def get_acl aces = [] @aces.each do |ace| aces << ace.get_ace end @additional.each do |ace| aces << ace.get_ace end aces end |
#get_default_ace ⇒ Object
format [default:]:[name]:(r|-)(w|-)(x|-) (or nil if none present)
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 18 def get_default_ace @aces.each do |ace| if ace.default return ace.get_ace end end @additional.each do |ace| if ace.default return ace.get_ace end end nil end |
#get_default_group_ace ⇒ Object
format [default:]:[name]:(r|-)(w|-)(x|-) (or nil if not present)
103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 103 def get_default_group_ace @aces.each do |ace| if ace.default && ace.type.eql?("group") && ace.name.eql?("") return ace.get_ace end end @additional.each do |ace| if ace.default && ace.type.eql?("group") && ace.name.eql?("") return ace.get_ace end end nil end |
#has_base_mask? ⇒ Boolean
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 66 def has_base_mask? @aces.each do |ace| if !ace.default && ace.type.eql?("mask") return true end end @additional.each do |ace| if !ace.default && ace.type.eql?("mask") return true end end false end |
#has_base_named? ⇒ Boolean
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 52 def has_base_named? @aces.each do |ace| if !ace.default && !ace.name.eql?("") return true end end @additional.each do |ace| if !ace.default && !ace.name.eql?("") return true end end false end |
#has_default? ⇒ Boolean
80 81 82 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 80 def has_default? !get_default_ace.nil? end |
#has_default_group? ⇒ Boolean
98 99 100 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 98 def has_default_group? !get_default_group_ace.nil? end |
#has_default_mask? ⇒ Boolean
145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 145 def has_default_mask? @aces.each do |ace| if ace.default && ace.type.eql?("mask") return true end end @additional.each do |ace| if ace.default && ace.type.eql?("mask") return true end end false end |
#has_default_named? ⇒ Boolean
131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 131 def has_default_named? @aces.each do |ace| if ace.default && !ace.name.eql?("") return true end end @additional.each do |ace| if ace.default && !ace.name.eql?("") return true end end false end |
#has_default_other? ⇒ Boolean
117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 117 def has_default_other? @aces.each do |ace| if ace.default && ace.type.eql?("other") return true end end @additional.each do |ace| if ace.default && ace.type.eql?("other") return true end end false end |
#has_default_user? ⇒ Boolean
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/instance_agent/plugins/codedeploy/application_specification/acl_info.rb', line 84 def has_default_user? @aces.each do |ace| if ace.default && ace.type.eql?("user") && ace.name.eql?("") return true end end @additional.each do |ace| if ace.default && ace.type.eql?("user") && ace.name.eql?("") return true end end false end |