With the introduction of the /public namespace all other endpoints, the
rest of the endpoints are restricted to privileged users.
This patch makes the GET /libraries and GET /libraries/:library_id
endpoints require 'catalogue' permissions.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
"$ref": "../definitions.json#/error"
}
}
"$ref": "../definitions.json#/error"
}
}
+ },
+ "x-koha-authorization": {
+ "permissions": {
+ "catalogue": "1"
+ }
"$ref": "../definitions.json#/error"
}
}
"$ref": "../definitions.json#/error"
}
}
+ },
+ "x-koha-authorization": {
+ "permissions": {
+ "catalogue": "1"
+ }
my $another_library = $library->unblessed; # create a copy of $library but make
delete $another_library->{branchcode}; # sure branchcode will be regenerated
$another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library });
my $another_library = $library->unblessed; # create a copy of $library but make
delete $another_library->{branchcode}; # sure branchcode will be regenerated
$another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library });
- my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 0 } );
+ my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 1 } );
## Authorized user tests
my $count_of_libraries = Koha::Libraries->search->count;
## Authorized user tests
my $count_of_libraries = Koha::Libraries->search->count;
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my ( $borrowernumber, $session_id ) =
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my ( $borrowernumber, $session_id ) =
- create_user_and_session( { authorized => 0 } );
+ create_user_and_session( { authorized => 1 } );
my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode );
$tx->req->cookies( { name => 'CGISESSID', value => $session_id } );
my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode );
$tx->req->cookies( { name => 'CGISESSID', value => $session_id } );