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 169-175 sub add { Link Here
169
            $can_place_hold->{status} = 'tooManyReserves';
171
            $can_place_hold->{status} = 'tooManyReserves';
170
        }
172
        }
171
173
172
        my $can_override = C4::Context->preference('AllowHoldPolicyOverride');
174
        my $override_header = $c->req->headers->header('x-koha-override');
175
        $override_header = decode_json($override_header)
176
          if $override_header;
177
178
        my $can_override = $override_header->{AllowHoldPolicyOverride}
179
          and C4::Context->preference('AllowHoldPolicyOverride');
173
180
174
        unless ($can_override || $can_place_hold->{status} eq 'OK' ) {
181
        unless ($can_override || $can_place_hold->{status} eq 'OK' ) {
175
            return $c->render(
182
            return $c->render(
(-)a/api/v1/swagger/paths/holds.json (-1 / +3 lines)
Lines 267-272 Link Here
267
        "permissions": {
267
        "permissions": {
268
          "reserveforothers": "1"
268
          "reserveforothers": "1"
269
        }
269
        }
270
      },
271
      "x-koha-override": {
272
        "AllowHoldPolicyOverride": 1
270
      }
273
      }
271
    }
274
    }
272
  },
275
  },
273
- 

Return to bug 26181