Bug 31643: Require only edit_catalogue, not full cataloging

To test:
1 - Grant a patron: catalogue, edit_catalogue, and editauthorities permissions
2 - Log in to staff client
3 - Browse to: http://localhost:8081/cgi-bin/koha/svc/cataloguing/automatic_linker.pl
4 - UNAUTHORIZED
5 - Apply patch, restart all
6 - Log in and go to link again
7 - status "OK"

Signed-off-by: Catrina <catrina@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb1ca33110)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e3db0a35c3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 7197149f6e)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Nick Clemens 2022-09-28 18:59:41 +00:00 committed by Wainui Witika-Park
parent b2c138252c
commit e77fe4e5df
1 changed files with 5 additions and 2 deletions

View File

@ -28,8 +28,11 @@ my $input = CGI->new;
print $input->header('application/json');
# Check the user's permissions
my ( $auth_status, $auth_sessid ) =
C4::Auth::check_cookie_auth( $input->cookie('CGISESSID'), { editauthorities => 1, editcatalogue => 1 } );
my ( $auth_status ) =
C4::Auth::check_cookie_auth( $input->cookie('CGISESSID'), {
editauthorities => 1,
editcatalogue => 'edit_catalogue'
});
if ( $auth_status ne "ok" ) {
print to_json( { status => 'UNAUTHORIZED' } );
exit 0;