Module: Chef::Mixin::EnforceOwnershipAndPermissions

Included in:
Provider::CookbookFile, Provider::Directory, Provider::File, Provider::Link, Provider::RemoteDirectory, Provider::RemoteFile, Provider::Template
Defined in:
lib/chef/mixin/enforce_ownership_and_permissions.rb

Instance Method Summary collapse

Instance Method Details

#access_controlsObject



25
26
27
# File 'lib/chef/mixin/enforce_ownership_and_permissions.rb', line 25

def access_controls
  @access_controls ||= Chef::FileAccessControl.new(current_resource, new_resource, self)
end

#enforce_ownership_and_permissionsObject

will set the proper user, group and permissions using a platform specific version of Chef::FileAccessControl



32
33
34
35
# File 'lib/chef/mixin/enforce_ownership_and_permissions.rb', line 32

def enforce_ownership_and_permissions
  access_controls.set_all
  new_resource.updated_by_last_action(true) if access_controls.modified?
end