@@ -, +, @@ 'x-koha-authorization' .. "x-koha-authorization": { "allow-owner": "1", "pemissions": { "borrowers": "1" } } --- Koha/REST/V1.pm | 6 +++--- api/v1/swagger/paths/holds.json | 8 ++++---- api/v1/swagger/paths/patrons.json | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) --- a/Koha/REST/V1.pm +++ a/Koha/REST/V1.pm @@ -83,11 +83,11 @@ sub authenticate_api_request { ); } - if ($action_spec->{'x-koha-permission'}) { + if ($action_spec->{'x-koha-authorization'}) { if (_allowOwner($c, $action_spec, $user)) { return $next->($c); } - my $permissions = $action_spec->{'x-koha-permission'}->{'permissions'}; + my $permissions = $action_spec->{'x-koha-authorization'}->{'permissions'}; if (C4::Auth::haspermission($user->userid, $permissions)) { return $next->($c); @@ -108,7 +108,7 @@ sub authenticate_api_request { sub _allowOwner { my ($c, $action_spec, $user) = @_; - my $allowOwner = $action_spec->{'x-koha-permission'}->{'allow-owner'}; + my $allowOwner = $action_spec->{'x-koha-authorization'}->{'allow-owner'}; return unless $allowOwner && $allowOwner == 1; if ($c->param("borrowernumber")) { --- a/api/v1/swagger/paths/holds.json +++ a/api/v1/swagger/paths/holds.json @@ -22,7 +22,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "allow-owner": "1", "permissions": { "borrowers": "1" @@ -99,7 +99,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "allow-owner": "1", "permissions": { "reserveforothers": "1" @@ -161,7 +161,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "permissions": { "reserveforothers": "1" } @@ -189,7 +189,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "permissions": { "reserveforothers": "1" } --- a/api/v1/swagger/paths/patrons.json +++ a/api/v1/swagger/paths/patrons.json @@ -23,7 +23,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "permissions": { "borrowers": "1" } @@ -61,7 +61,7 @@ } } }, - "x-koha-permission": { + "x-koha-authorization": { "allow-owner": "1", "permissions": { "borrowers": "1" --