View | Details | Raw Unified | Return to bug 28759
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 57-63 Link Here
57
                [% END %]
57
                [% END %]
58
58
59
                [% IF Koha.Preference('RESTOAuth2ClientCredentials') %]
59
                [% IF Koha.Preference('RESTOAuth2ClientCredentials') %]
60
                    [% IF CAN_user_borrowers_edit_borrowers %]
60
                    [% IF CAN_user_superlibrarian OR loggedinusernumber == patron.borrowernumber %]
61
                        <li><a id="apikeys" href="/cgi-bin/koha/members/apikeys.pl?patron_id=[% patron.borrowernumber | html %]">Manage API keys</a></li>
61
                        <li><a id="apikeys" href="/cgi-bin/koha/members/apikeys.pl?patron_id=[% patron.borrowernumber | html %]">Manage API keys</a></li>
62
                    [% ELSE %]
62
                    [% ELSE %]
63
                        <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to manage API keys" id="apikeys" href="#">Manage API keys</a></li>
63
                        <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to manage API keys" id="apikeys" href="#">Manage API keys</a></li>
(-)a/members/apikeys.pl (-1 / +6 lines)
Lines 52-57 if ( not defined $patron or Link Here
52
    exit;
52
    exit;
53
}
53
}
54
54
55
if( $patron_id != $loggedinuser && !C4::Context->IsSuperLibrarian() ) {
56
    # not the owner of the account viewing/editing own API keys, nor superlibrarian -> exit
57
    print $cgi->redirect("/cgi-bin/koha/errors/403.pl"); # escape early
58
    exit;
59
}
60
55
my $op = $cgi->param('op') // '';
61
my $op = $cgi->param('op') // '';
56
62
57
if ( $op eq 'generate' or
63
if ( $op eq 'generate' or
58
- 

Return to bug 28759