diff --git a/app/policies/location_request_link_policy.rb b/app/policies/location_request_link_policy.rb index 350359564..574de972a 100644 --- a/app/policies/location_request_link_policy.rb +++ b/app/policies/location_request_link_policy.rb @@ -13,7 +13,9 @@ def show? end def aeon_pageable? - folio_aeon_pageable? if folio_items? + return false if !folio_items? || folio_permanent_locations.none? + + folio_permanent_locations.all? { |location| location.dig('details', 'pageAeonSite') } end private @@ -36,7 +38,7 @@ def folio_pageable? !folio_disabled_status_location? && (folio_mediated_pageable? || - folio_aeon_pageable? || + aeon_pageable? || folio_item_pageable?) end @@ -56,12 +58,6 @@ def folio_mediated_pageable? folio_permanent_locations.all? { |location| location.dig('details', 'pageMediationGroupKey') } end - def folio_aeon_pageable? - return false unless folio_items? && folio_permanent_locations.any? - - folio_permanent_locations.all? { |location| location.dig('details', 'pageAeonSite') } - end - def folio_item_pageable? items.any? do |item| item.allowed_request_types&.include?('Page')