From 81567887d3117f1bb1ed64b717eb0f628e149185 Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Wed, 27 Jan 2016 12:44:00 -0800 Subject: changes to test chef-zero ACLs. --- lib/chef_zero/chef_data/acl_path.rb | 3 ++- lib/chef_zero/chef_data/default_creator.rb | 6 ++++-- lib/chef_zero/data_store/memory_store_v2.rb | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/chef_zero/chef_data/acl_path.rb b/lib/chef_zero/chef_data/acl_path.rb index c783a1a..52b43d4 100644 --- a/lib/chef_zero/chef_data/acl_path.rb +++ b/lib/chef_zero/chef_data/acl_path.rb @@ -13,7 +13,8 @@ module ChefZero # specified on X, they are not inherited from X's parent # - stop adding pivotal to acls (he already has access to what he needs) module AclPath - ORG_DATA_TYPES = %w(clients cookbooks containers data environments groups nodes roles sandboxes) + ORG_DATA_TYPES = %w(clients cookbook_artifacts cookbooks containers data environments groups + nodes policies policy_groups roles sandboxes) TOP_DATA_TYPES = %w(containers organizations users) # ACL data paths for a partition are: diff --git a/lib/chef_zero/chef_data/default_creator.rb b/lib/chef_zero/chef_data/default_creator.rb index b066a25..38be6f3 100644 --- a/lib/chef_zero/chef_data/default_creator.rb +++ b/lib/chef_zero/chef_data/default_creator.rb @@ -148,6 +148,7 @@ module ChefZero DEFAULT_ORG_SPINE = { 'clients' => {}, + 'cookbook_artifacts' => {}, 'cookbooks' => {}, 'data' => {}, 'environments' => %w(_default), @@ -281,7 +282,8 @@ module ChefZero 'delete' => { 'groups' => %w(admins) }, 'grant' => { 'groups' => %w(admins) }, } - when 'containers/cookbooks', 'containers/environments', 'containers/roles' + when 'containers/cookbook_artifacts', 'containers/cookbooks', + 'containers/environments', 'containers/policies', 'containers/policy_groups', 'containers/roles' { 'create' => { 'groups' => %w(admins users) }, 'read' => { 'groups' => %w(admins users clients) }, @@ -289,7 +291,7 @@ module ChefZero 'delete' => { 'groups' => %w(admins users) }, 'grant' => { 'groups' => %w(admins) }, } - when 'containers/cookbooks', 'containers/data' + when 'containers/data' { 'create' => { 'groups' => %w(admins users clients) }, 'read' => { 'groups' => %w(admins users clients) }, diff --git a/lib/chef_zero/data_store/memory_store_v2.rb b/lib/chef_zero/data_store/memory_store_v2.rb index d330972..afed5d6 100644 --- a/lib/chef_zero/data_store/memory_store_v2.rb +++ b/lib/chef_zero/data_store/memory_store_v2.rb @@ -114,6 +114,7 @@ module ChefZero begin value = _get(path) if value.is_a?(Hash) && !options[:allow_dirs] + require 'pry'; binding.pry raise "exists? does not work with directories (#{path} = #{value.class})" end return true -- cgit v1.2.1