From be8c6e023925f92723681e169956c7a72f9bf062 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Apr 2014 16:57:58 +0200 Subject: [PATCH] Bug 7673: Change the superlibrarian check To know if the user is a superlibrarian, we have to call C4::Context->IsSuperLibrarian Signed-off-by: Koha Team AMU --- cataloguing/additem.pl | 2 +- tools/batchMod.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index f2df4a0..3908edd 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -372,7 +372,7 @@ my ($template, $loggedinuser, $cookie) my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; # In case user is a superlibrarian, edition is not restricted -$restrictededition = 0 if ($restrictededition != 0 && $restrictededition->{'superlibrarian'} eq 1); +$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); # In case user has fast cataloging permission (and we're in fast cataloging), edition is not restricted $restrictededition = 0 if ($restrictededition != 0 && $frameworkcode eq 'FA' && haspermission($uid, {'editcatalogue' => 'fast_cataloging'})); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index d308309..0a880bb 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -74,7 +74,7 @@ my ($template, $loggedinuser, $cookie) my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; # In case user is a superlibrarian, edition is not restricted -$restrictededition = 0 if ($restrictededition != 0 && $restrictededition->{'superlibrarian'} eq 1); +$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); my $today_iso = C4::Dates->today('iso'); $template->param(today_iso => $today_iso); -- 2.0.0.rc2