Sha256: 145bfef83fd6460e97334bde41df8ce6084d0c93e810e389383d3b12038f5b9e
Contents?: true
Size: 728 Bytes
Versions: 48
Compression:
Stored size: 728 Bytes
Contents
# A job to apply work permissions to all contained files set # class InheritPermissionsJob < Hyrax::ApplicationJob # Perform the copy from the work to the contained filesets # # @param work containing access level and filesets def perform(work) work.file_sets.each do |file| attribute_map = work.permissions.map(&:to_hash) # copy and removed access to the new access with the delete flag file.permissions.map(&:to_hash).each do |perm| unless attribute_map.include?(perm) perm[:_destroy] = true attribute_map << perm end end # apply the new and deleted attributes file.permissions_attributes = attribute_map file.save! end end end
Version data entries
48 entries across 48 versions & 1 rubygems