Bugzilla – Attachment 92037 Details for
Bug 17390
Add REST API endpoint for Authorised Values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17390: Update for current Koha codebase
Bug-17390-Update-for-current-Koha-codebase.patch (text/plain), 3.46 KB, created by
Josef Moravec
on 2019-08-07 08:54:03 UTC
(
hide
)
Description:
Bug 17390: Update for current Koha codebase
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-08-07 08:54:03 UTC
Size:
3.46 KB
patch
obsolete
>From 0b4eca5f11bc970cb0de90b51d8b4af624b48f71 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 7 Aug 2019 08:53:18 +0000 >Subject: [PATCH] Bug 17390: Update for current Koha codebase > >--- > Koha/REST/V1/AuthorisedValue.pm | 48 ----------------------------- > api/v1/swagger/paths/authorised_values.json | 26 ++++++++++++++++ > 2 files changed, 26 insertions(+), 48 deletions(-) > delete mode 100644 Koha/REST/V1/AuthorisedValue.pm > >diff --git a/Koha/REST/V1/AuthorisedValue.pm b/Koha/REST/V1/AuthorisedValue.pm >deleted file mode 100644 >index 141b6d5d76..0000000000 >--- a/Koha/REST/V1/AuthorisedValue.pm >+++ /dev/null >@@ -1,48 +0,0 @@ >-package Koha::REST::V1::AuthorisedValue; >- >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 3 of the License, or (at your option) any later >-# version. >-# >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >- >-use Modern::Perl; >- >-use Mojo::Base 'Mojolicious::Controller'; >- >-use C4::Auth qw( haspermission ); >-use Koha::AuthorizedValues; >- >-BEGIN { >- warn "TEST"; >-} >- >-sub list { >- my ( $c, $args, $cb ) = @_; >- >- my $user = $c->stash('koha.user'); >- unless ( $user && haspermission( $user->userid, { catalogue => 1 } ) ) { >- return $c->$cb( >- { >- error => "You don't have the required permission" >- }, >- 403 >- ); >- } >- >- my $params = $c->req->params->to_hash; >- my $av = Koha::Account::AuthorisedValues->search($params); >- >- return $c->$cb( $av->unblessed, 200 ); >-} >- >-1; >diff --git a/api/v1/swagger/paths/authorised_values.json b/api/v1/swagger/paths/authorised_values.json >index 084c58bbb8..4da3de221d 100644 >--- a/api/v1/swagger/paths/authorised_values.json >+++ b/api/v1/swagger/paths/authorised_values.json >@@ -1,11 +1,25 @@ > { > "/authorised_values": { > "get": { >+ "x-mojo-to": "AuthorisedValues#list", > "operationId": "listAuthorisedValues", > "tags": ["authorised", "values"], > "produces": [ > "application/json" > ], >+ "parameters": [{ >+ "name": "category", >+ "in": "query", >+ "description": "Search authorised values by category", >+ "required": false, >+ "type": "string" >+ }, { >+ "name": "value", >+ "in": "query", >+ "description": "Search authorised values by value", >+ "required": false, >+ "type": "string" >+ }], > "responses": { > "200": { > "description": "A list of authorised values", >@@ -21,6 +35,18 @@ > "schema": { > "$ref": "../definitions.json#/error" > } >+ }, >+ "500": { >+ "description": "Internal error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } > } > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17390
:
55979
|
55980
|
92036
|
92037
|
105820
|
105849
|
162138