Bug 29955: Fix method import issues
This patch fixes this:
$ prove t/db_dependent/Utils/Datatables_Virtualshelves.t
t/db_dependent/Utils/Datatables_Virtualshelves.t .. 2/13 Use of inherited AUTOLOAD for non-method Koha::Virtualshelf::haspermission() is no longer allowed at /kohadevbox/koha/Koha/Virtualshelf.pm line 248.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=32080
Signed-off-by: Blou <blou@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 432fa9415d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
parent
cdde1c89ad
commit
f9719f7bd8
|
|
@ -18,7 +18,7 @@ package Koha::Virtualshelf;
|
|||
use Modern::Perl;
|
||||
|
||||
|
||||
use C4::Auth qw( haspermission );
|
||||
use C4::Auth;
|
||||
|
||||
use Koha::Patrons;
|
||||
use Koha::Database;
|
||||
|
|
@ -237,6 +237,11 @@ sub can_be_managed {
|
|||
my ( $self, $borrowernumber ) = @_;
|
||||
return 1
|
||||
if $borrowernumber and $self->owner == $borrowernumber;
|
||||
|
||||
my $patron = Koha::Patrons->find( $borrowernumber ) or return 0;
|
||||
return 1
|
||||
if $self->is_public and C4::Auth::haspermission( $patron->userid, { lists => 'edit_public_lists' } );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue