• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / 4c391e0e-519a-40cb-8ad3-354445f4ce03

12 Aug 2025 08:47PM UTC coverage: 85.348% (-10.0%) from 95.335%
4c391e0e-519a-40cb-8ad3-354445f4ce03

push

circleci

web-flow
[#5143] Use access restriction note as Aeon ItemInfo1 if available (#5173)

With this commit, if a user visits a record with an access
restrictions note and presses the Reading Room Request
button, they will get to an Aeon form with the 'Restrictions'
field pre-filled with the restriction note.

If the record does not have an access restrictions note,
the field will be pre-filled with 'Reading Room Access Only',
as it has been previously.

Closes #5143

5493 of 6436 relevant lines covered (85.35%)

251.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.1
/lib/orangelight/illiad_account.rb
1
# frozen_string_literal: true
2

3
require 'faraday'
1✔
4
require 'faraday-cookie_jar'
1✔
5
module Orangelight
1✔
6
  class IlliadAccount
1✔
7
    def initialize(patron)
1✔
8
      @patron = patron
10✔
9
      @barcode = patron['barcode']
10✔
10
      @last_name = patron['last_name']
10✔
11
      @patron_id = patron['patron_id']
10✔
12
      @netid = patron['netid']
10✔
13
      @illiad_api_key = Requests.config["illiad_api_key"]
10✔
14
      @illiad_api_base = Requests.config["illiad_api_base"]
10✔
15
    end
16

17
    def verify_user?
1✔
18
      return false if illiad_patron_response == false
×
19

20
      illiad_patron_response&.success?
×
21
    end
22

23
    def illiad_patron_response
1✔
24
      @illiad_patron_response ||= begin
10✔
25
        url = "/ILLiadWebPlatform/Users/#{netid}"
10✔
26
        Rails.logger.debug { "Illiad Get #{@illiad_api_base}/#{url}" }
20✔
27
        response = conn.get do |req|
10✔
28
          req.url url
10✔
29
          req.headers['Accept'] = 'application/json'
10✔
30
          req.headers['ApiKey'] = @illiad_api_key
10✔
31
        end
32
        Rails.logger.debug { "Illiad Get Response #{@illiad_api_base}/#{url} #{response.status} #{response.body}" }
20✔
33
        response
10✔
34
      end
35
    rescue Faraday::ConnectionFailed
36
      Rails.logger.warn("Unable to Connect to #{@illiad_api_base}")
×
37
      false
×
38
    end
39

40
    private
1✔
41

42
      attr_reader :patron, :netid
1✔
43

44
      def conn
1✔
45
        @conn ||= IlliadPatronClient.new(patron).conn
10✔
46
      end
47
  end
48
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc