Bug 20649

Summary: C4::Auth should use C4::Context->IsSuperLibrarian()
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AuthenticationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: dpavlin, jonathan.druart
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 20479    
Bug Blocks:    

Description Katrin Fischer 2018-04-24 11:19:38 UTC
We had a lot of trouble with superlibrarian checks in the past, which is why we introduced C4::Context->IsSuperLibrarian(). C4::Auth should use it instead of:

06             && $flags && $flags->{superlibrarian} != 1

http://git.koha-community.org/gitweb/?p=koha.git;a=blobdiff;f=C4/Auth.pm;h=e0cbbc567746dbce7415253f966ce227c58956d7;hp=1b24c4fdb10f746ff81184b6f6edbff17eb4a3d8;hb=d8b3497368b839e4fc594661719351efbe3433cc;hpb=51d7a02726b81b28325f7a151c8670e2f2293f71
Comment 1 Katrin Fischer 2018-04-24 11:36:13 UTC
Probably here too, noting that on bug 20515:

 297         if ( $flags && $flags->{superlibrarian} == 1 ) {
 298             $template->param( CAN_user_circulate        => 1 );
Comment 2 Jonathan Druart 2018-04-24 13:47:54 UTC
No, C4::Context->IsSuperlibrarian tells if the logged in user has the superlibrarian flags.
In C4::Auth::get_template_and_user the user is not logged in yet.
Comment 3 Jonathan Druart 2018-04-24 13:56:17 UTC
Actually yes, userenv is set in checkauth which has been called few lines above.
Comment 4 Katrin Fischer 2019-02-10 13:15:37 UTC
Sorry, Jonathan, I don't understand yet. Maybe we can take a look at it together sometime?
Comment 5 Jonathan Druart 2019-03-04 18:47:25 UTC
(In reply to Katrin Fischer from comment #4)
> Sorry, Jonathan, I don't understand yet. Maybe we can take a look at it
> together sometime?

Scratch comment 2, we could replace it instead.