summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@chef.io>2016-01-27 12:44:00 -0800
committerChris Doherty <cdoherty@chef.io>2016-01-27 12:44:00 -0800
commit81567887d3117f1bb1ed64b717eb0f628e149185 (patch)
tree58de7f63d4630d57401988f843efe736d65df59b
parent225ce88e3e3fc327d39ad79da2c01ccbca37dc92 (diff)
downloadchef-zero-81567887d3117f1bb1ed64b717eb0f628e149185.tar.gz
changes to test chef-zero ACLs.
-rw-r--r--lib/chef_zero/chef_data/acl_path.rb3
-rw-r--r--lib/chef_zero/chef_data/default_creator.rb6
-rw-r--r--lib/chef_zero/data_store/memory_store_v2.rb1
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