Class: OpscodeAcl::AclRemove
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- OpscodeAcl::AclRemove
- Defined in:
- lib/chef/knife/acl_remove.rb
Instance Attribute Summary collapse
-
#actor_name ⇒ Object
readonly
Returns the value of attribute actor_name.
-
#actor_type ⇒ Object
readonly
Returns the value of attribute actor_type.
-
#object_name ⇒ Object
readonly
Returns the value of attribute object_name.
-
#object_type ⇒ Object
readonly
Returns the value of attribute object_type.
-
#perm ⇒ Object
readonly
Returns the value of attribute perm.
Instance Method Summary collapse
- #remove_actor_from_ace!(name, ace) ⇒ Object
- #remove_group_from_ace!(name, ace) ⇒ Object
- #run ⇒ Object
Instance Attribute Details
#actor_name ⇒ Object (readonly)
Returns the value of attribute actor_name.
24 25 26 |
# File 'lib/chef/knife/acl_remove.rb', line 24 def actor_name @actor_name end |
#actor_type ⇒ Object (readonly)
Returns the value of attribute actor_type.
24 25 26 |
# File 'lib/chef/knife/acl_remove.rb', line 24 def actor_type @actor_type end |
#object_name ⇒ Object (readonly)
Returns the value of attribute object_name.
24 25 26 |
# File 'lib/chef/knife/acl_remove.rb', line 24 def object_name @object_name end |
#object_type ⇒ Object (readonly)
Returns the value of attribute object_type.
24 25 26 |
# File 'lib/chef/knife/acl_remove.rb', line 24 def object_type @object_type end |
#perm ⇒ Object (readonly)
Returns the value of attribute perm.
24 25 26 |
# File 'lib/chef/knife/acl_remove.rb', line 24 def perm @perm end |
Instance Method Details
#remove_actor_from_ace!(name, ace) ⇒ Object
58 59 60 |
# File 'lib/chef/knife/acl_remove.rb', line 58 def remove_actor_from_ace!(name, ace) ace['actors'].delete(name) end |
#remove_group_from_ace!(name, ace) ⇒ Object
54 55 56 |
# File 'lib/chef/knife/acl_remove.rb', line 54 def remove_group_from_ace!(name, ace) ace['groups'].delete(name) end |
#run ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/chef/knife/acl_remove.rb', line 30 def run @object_type, @object_name, @perm, @actor_type, @actor_name = name_args if name_args.length < 5 show_usage ui.fatal "You must specify the object_type, object_name, perm, actor type (client or group), and actor name" exit 1 end validate_all_params! ace = get_ace(object_type, object_name, perm) case actor_type when "client" remove_actor_from_ace!(actor_name, ace) when "group" remove_group_from_ace!(actor_name, ace) when "users" # Not Implemented yet, we shouldn't get here. end update_ace!(object_type, object_name, perm, ace) end |