Sha256: 1a94787988ffea3b359574740708871b4d7b5e807eb6946c5139abcea6cec608
Contents?: true
Size: 692 Bytes
Versions: 5
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
5 entries across 5 versions & 1 rubygems