View | Details | Raw Unified | Return to bug 26181
Collapse All | Expand All

(-)a/Koha/REST/V1/Holds.pm (-1 / +8 lines)
Lines 19-24 use Modern::Perl; Link Here
19
19
20
use Mojo::Base 'Mojolicious::Controller';
20
use Mojo::Base 'Mojolicious::Controller';
21
21
22
use Mojo::JSON qw(decode_json);
23
22
use C4::Biblio;
24
use C4::Biblio;
23
use C4::Reserves;
25
use C4::Reserves;
24
26
Lines 132-138 sub add { Link Here
132
            ? C4::Reserves::CanItemBeReserved( $patron_id, $item_id )
134
            ? C4::Reserves::CanItemBeReserved( $patron_id, $item_id )
133
            : C4::Reserves::CanBookBeReserved( $patron_id, $biblio_id );
135
            : C4::Reserves::CanBookBeReserved( $patron_id, $biblio_id );
134
136
135
        my $can_override = C4::Context->preference('AllowHoldPolicyOverride');
137
        my $override_header = $c->req->headers->header('x-koha-override');
138
        $override_header = decode_json($override_header)
139
          if $override_header;
140
141
        my $can_override = $override_header->{AllowHoldPolicyOverride}
142
          and C4::Context->preference('AllowHoldPolicyOverride');
136
143
137
        unless ($can_override || $can_place_hold->{status} eq 'OK' ) {
144
        unless ($can_override || $can_place_hold->{status} eq 'OK' ) {
138
            return $c->render(
145
            return $c->render(
(-)a/api/v1/swagger/paths/holds.json (-1 / +3 lines)
Lines 257-262 Link Here
257
        "permissions": {
257
        "permissions": {
258
          "reserveforothers": "1"
258
          "reserveforothers": "1"
259
        }
259
        }
260
      },
261
      "x-koha-override": {
262
        "AllowHoldPolicyOverride": 1
260
      }
263
      }
261
    }
264
    }
262
  },
265
  },
263
- 

Return to bug 26181