Bug 11897: Use 'stockrotation' permission for the endpoint
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 4 Oct 2018 17:24:16 +0000 (14:24 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 9 Oct 2018 15:46:06 +0000 (15:46 +0000)
This patch makes the tests for 'authorized' session use the
'stockrotation' permission instead of 'superlibrarian'.

The path x-koha-permission is fixed accordingly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
api/v1/swagger/paths/rotas.json
t/db_dependent/api/v1/stockrotationstage.t

index 0cdda30..5c5fc3b 100644 (file)
@@ -71,7 +71,7 @@
             },
             "x-koha-authorization": {
                 "permissions": {
-                    "borrowers": "1"
+                    "stockrotation": "1"
                 }
             }
         }
index c76e9b1..23da8eb 100644 (file)
@@ -139,7 +139,7 @@ subtest 'move() tests' => sub {
 sub create_user_and_session {
 
     my $args  = shift;
-    my $flags = ( $args->{authorized} ) ? $args->{authorized} : 0;
+    my $flags = ( $args->{authorized} ) ? 2 ** 24 : 0; # stockrotation == 24
     my $dbh   = C4::Context->dbh;
 
     my $user = $builder->build(