# class Chef::ChefFS::FileSystem::AclEntry

### Constants

PERMISSIONS

### Public Instance Methods

api_path() click to toggle source

    # File lib/chef/chef_fs/file_system/acl_entry.rb, line 30
    def api_path
      "#{super}/_acl"
    end

delete(recurse) click to toggle source

    # File lib/chef/chef_fs/file_system/acl_entry.rb, line 34
    def delete(recurse)
      raise Chef::ChefFS::FileSystem::OperationNotAllowedError.new(:delete, self, e), "ACLs cannot be deleted."
    end

write(file_contents) click to toggle source

    # File lib/chef/chef_fs/file_system/acl_entry.rb, line 38
    def write(file_contents)
      # ACL writes are fun.
      acls = data_handler.normalize(JSON.parse(file_contents, :create_additions => false), self)
      PERMISSIONS.each do |permission|
        begin
          rest.put("#{api_path}/#{permission}", { permission => acls[permission] })
        rescue Timeout::Error => e
          raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self, e), "Timeout writing: #{e}"
        rescue Net::HTTPServerException => e
          if e.response.code == "404"
            raise Chef::ChefFS::FileSystem::NotFoundError.new(self, e)
          else
            raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self, e), "HTTP error writing: #{e}"
          end
        end
      end
    end