Bug 18403: REST API - patrons endpoint
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 10 Apr 2017 20:34:34 +0000 (17:34 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 18:41:42 +0000 (15:41 -0300)
There is something wrond here, the userenv is no set and so we cannot
user search_limited.
Should we set the userenv or filter on the libraries using
libraries_where_can_see_patrons?
WAITING FOR FEEDBACK HERE.

Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha/REST/V1/Patron.pm
api/v1/swagger/paths/holds.json
api/v1/swagger/paths/patrons.json

index 7cc7bed..8fbe458 100644 (file)
@@ -24,7 +24,8 @@ use Koha::Patrons;
 sub list {
     my $c = shift->openapi->valid_input or return;
 
-    my $patrons = Koha::Patrons->search;
+    # FIXME The limited does not work here, the userenv is not set
+    my $patrons = Koha::Patrons->search_limited;
 
     return $c->render(status => 200, openapi => $patrons);
 }
index adf1178..6bbcd40 100644 (file)
         "allow-owner": true,
         "allow-guarantor": true,
         "permissions": {
-          "borrowers": "1"
+          "borrowers": "edit_borrowers"
         }
       }
     },
index 204ccdf..565d20c 100644 (file)
@@ -44,7 +44,7 @@
       },
       "x-koha-authorization": {
         "permissions": {
-          "borrowers": "1"
+          "borrowers": "edit_borrowers"
         }
       }
     }
         "allow-owner": true,
         "allow-guarantor": true,
         "permissions": {
-          "borrowers": "1"
+          "borrowers": "edit_borrowers"
         }
       }
     }