Class Method Details

.get_acl_data_path(path) ⇒ Object

This method takes a Chef REST path and returns the chef-zero path used to look up the ACL. If an object does not have an ACL directly, it will return nil. Paths like /organizations/ORG/data/bag/item will return nil, because it is the parent path (data/bag) that has an ACL.

42
43
44
45
46
47
48
49
50
51
52

# File 'lib/chef_zero/chef_data/acl_path.rb', line 42defself.get_acl_data_path(path)# Things under organizations have their own acls hierarchyifpath[0]=='organizations'&&path.size>=2under_org=partition_acl_data_path(path[2..-1],ORG_DATA_TYPES)ifunder_orgpath[0..1]+under_orgendelsepartition_acl_data_path(path,TOP_DATA_TYPES)endend