Sha256: 890f139d4cfa5e088294456028f5e9cf23a9ff3ad9e18b7db28c883aedcabb02
Contents?: true
Size: 692 Bytes
Versions: 14
Compression:
Stored size: 692 Bytes
Contents
# frozen_string_literal: true module Hyrax module Listeners ## # Reindexes resources when their ACLs are updated. # # Hyrax's `Ability` behavior depends on the index being up-to-date as # concerns-their read/write users/groups, and visibility. class AclIndexListener ## # Re-index the resource for the updated ACL. # # Called when 'object.acl.updated' event is published # @param [Dry::Events::Event] event # @return [void] def on_object_acl_updated(event) return unless event[:result] == :success # do nothing on failure Hyrax.index_adapter.save(resource: event[:acl].resource) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems