summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system/chef_server/org_entry.rb
blob: f2dfc944cd9e32ef61d92dbd6d2928b11c69678f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require_relative "rest_list_entry"
require_relative "../../data_handler/organization_data_handler"

class Chef
  module ChefFS
    module FileSystem
      module ChefServer
        # /organizations/NAME/org.json
        # Represents the actual data at /organizations/NAME (the full name, etc.)
        class OrgEntry < RestListEntry
          def data_handler
            Chef::ChefFS::DataHandler::OrganizationDataHandler.new
          end

          # /organizations/foo/org.json -> GET /organizations/foo
          def api_path
            parent.api_path
          end

          def display_path
            "/org.json"
          end

          def exists?
            parent.exists?
          end

          def delete(recurse)
            raise Chef::ChefFS::FileSystem::OperationNotAllowedError.new(:delete, self)
          end
        end
      end
    end
  end
end