https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26383

--- Comment #4 from David Cook <dc...@prosentient.com.au> ---
Comment on attachment 122341
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122341
Bug 26383: WIP Replace C4::Context->IsSuperLibrarian with
Koha::Patron->is_superlibrarian

Review of attachment 122341:
 --> 
(https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=26383&attachment=122341)
-----------------------------------------------------------------

::: C4/Circulation.pm
@@ +1073,5 @@
> +
> +    my $userenv = C4::Context->userenv;
> +    if ( C4::Context->preference("IndependentBranches") && $userenv ) {
> +        my $logged_in_user = Koha::Patrons->find($userenv->{number});
> +        unless ( $logged_in_user->is_superlibrarian ) {

Technically, the session stores the flags value, so we could just do the
calculation off the session data. The only downside of doing that is that we
probably only set the flags session data at login time, so if someone's
permissions change while they're logged in, it won't be detected until they've
logged out and logged back in. But... it would mean fewer database calls.

If we're doing a multi-checkout, the number of database calls would increase by
that factor...

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to