Class: Chef::ChefFS::FileSystem::ChefServer::AclDir
- Inherits:
-
BaseFSDir
show all
- Defined in:
- lib/chef/chef_fs/file_system/chef_server/acl_dir.rb
Instance Attribute Summary
Attributes inherited from BaseFSObject
#name, #parent, #path
Instance Method Summary
collapse
Methods inherited from BaseFSDir
#dir?, #empty?, #initialize
#chef_object, #child, #compare_to, #delete, #dir?, #exists?, #initialize, #path_for_printing, #read, #root, #write
Instance Method Details
#api_path ⇒ Object
28
29
30
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 28
def api_path
parent.parent.child(name).api_path
end
|
#can_have_child?(name, is_dir) ⇒ Boolean
37
38
39
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 37
def can_have_child?(name, is_dir)
!is_dir
end
|
#children ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 41
def children
if @children.nil?
names = parent.parent.child(name).children.map { |child| child.dir? ? "#{child.name}.json" : child.name }
@children = names.map { |name| make_child_entry(name, true) }
end
@children
end
|
#create_child(name, file_contents) ⇒ Object
50
51
52
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 50
def create_child(name, file_contents)
raise OperationNotAllowedError.new(:create_child, self, nil, "ACLs can only be updated, and can only be created when the corresponding object is created.")
end
|
#data_handler ⇒ Object
54
55
56
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 54
def data_handler
parent.data_handler
end
|
#make_child_entry(name, exists = nil) ⇒ Object
32
33
34
35
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 32
def make_child_entry(name, exists = nil)
result = @children.find { |child| child.name == name } if @children
result || AclEntry.new(name, self, exists)
end
|
#rest ⇒ Object
58
59
60
|
# File 'lib/chef/chef_fs/file_system/chef_server/acl_dir.rb', line 58
def rest
parent.rest
end
|