summaryrefslogtreecommitdiff
path: root/lib/chef_zero/data_store/default_facade.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-07-24 06:42:06 -0600
committerJohn Keiser <jkeiser@opscode.com>2014-08-22 09:20:48 -0700
commit9a443988b73b53238e1ad82a2d0330c72bc869f2 (patch)
treea113d407e3afa401ac388e765a78f1c23c877200 /lib/chef_zero/data_store/default_facade.rb
parentdbb7dbdee734e0735c3a060370d26a13ce0d756d (diff)
downloadchef-zero-9a443988b73b53238e1ad82a2d0330c72bc869f2.tar.gz
Both organization/_acl and organizations/_acl exist
Diffstat (limited to 'lib/chef_zero/data_store/default_facade.rb')
-rw-r--r--lib/chef_zero/data_store/default_facade.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/chef_zero/data_store/default_facade.rb b/lib/chef_zero/data_store/default_facade.rb
index fd5e7b7..a44e3e0 100644
--- a/lib/chef_zero/data_store/default_facade.rb
+++ b/lib/chef_zero/data_store/default_facade.rb
@@ -3,14 +3,16 @@ require 'chef_zero/data_store/interface_v2'
module ChefZero
module DataStore
class DefaultFacade < ChefZero::DataStore::InterfaceV2
- def initialize(real_store, osc_compat)
+ def initialize(real_store, osc_compat, superusers = [ 'pivotal' ])
@real_store = real_store
@osc_compat = osc_compat
+ @superusers = superusers
clear
end
attr_reader :real_store
attr_reader :osc_compat
+ attr_reader :superusers
def default(path, name=nil)
value = @defaults
@@ -73,9 +75,10 @@ module ChefZero
'acls' => {}
}
unless osc_compat
- @defaults['users'] = {
- 'pivotal' => '{}'
- }
+ @defaults['users'] = {}
+ superusers.each do |superuser|
+ @defaults['users'][superuser] = '{}'
+ end
end
end
@@ -310,8 +313,15 @@ module ChefZero
},
'nodes' => {},
'roles' => {},
+ 'organization' => %'{
+ "create": { "actors": #{superusers.inspect} },
+ "read": { "actors": #{superusers.inspect}, "groups": [ "admins", "users" ] },
+ "update": { "actors": #{superusers.inspect} },
+ "delete": { "actors": #{superusers.inspect} },
+ "grant": { "actors": #{superusers.inspect} }
+ }',
'organizations' => '{
- "read": { "groups": [ "admins", "users" ] }
+ "read": { "groups": [ "admins", "users" ]}
}',
'sandboxes' => {}
},