Bug 20479: Use $flag instead of fetching patron
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Mar 2018 15:47:54 +0000 (12:47 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Mar 2018 16:39:21 +0000 (13:39 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Auth.pm

index e0cbbc5..3f1c9dd 100644 (file)
@@ -204,7 +204,8 @@ sub get_template_and_user {
                 $in->{template_name} =~ m|sco/| && haspermission(
                     $user, { self_check => 'self_checkout_module' }
                 )
-            ) && Koha::Patrons->find({userid=>$user}) && Koha::Patrons->find({userid=>$user})->flags != 1
+            )
+            && $flags && $flags->{superlibrarian} != 1
           )
         {
             $kick_out = 1;