Bug 20479: Use $flag instead of fetching patron
[koha.git] / C4 / Auth.pm
index f09817e..3f1c9dd 100644 (file)
@@ -196,6 +196,7 @@ sub get_template_and_user {
         elsif (
 # If the user logged in is the SCI user and they try to go out of the SCI module,
 # kick them out unless it is SCO with a valid permission
+# or they are a superlibrarian
                $in->{template_name} !~ m|sci/|
             && $user
             && haspermission( $user, { self_check => 'self_checkin_module' } )
@@ -204,6 +205,7 @@ sub get_template_and_user {
                     $user, { self_check => 'self_checkout_module' }
                 )
             )
+            && $flags && $flags->{superlibrarian} != 1
           )
         {
             $kick_out = 1;