From 20c1fac16bdc51e9653ad9a79d7bcdddcbc0fd60 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 18 Apr 2014 20:47:48 +0000 Subject: [PATCH] Bug 12098: (follow-up) put can_show_subscription() into use This patch puts C4::Serials::can_show_subscription() into use. Note that there is user-visible change: if a subscription has a blank library, all users with serials permissions will be able to view and/or edit it. It remains to be determined whether we *want* such subscriptions to exist, or if they should only be tied to specific libraries. Signed-off-by: Galen Charlton (cherry picked from commit dc6d8a2199f79e36839a2769994883e04b61cb67) Signed-off-by: Fridolin Somers --- C4/Serials.pm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index c4282f25b0..0cf8febb83 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -734,20 +734,9 @@ sub SearchSubscriptions { my $results = $sth->fetchall_arrayref( {} ); $sth->finish; - my $cant_display_other_branches = 0; - if (my $env = C4::Context->userenv) { - my $userid = $env->{'id'}; - $cant_display_other_branches = - C4::Context->preference('IndependentBranches') && - !C4::Context->IsSuperLibrarian() && - !C4::Auth::haspermission( $userid, {serials => 'superserials'}); - } - my $user_branch = C4::Context->userenv ? C4::Context->userenv->{'branch'} : q{}; for my $subscription ( @$results ) { $subscription->{cannotedit} = not can_edit_subscription( $subscription ); - $subscription->{cannotdisplay} = - $cant_display_other_branches && - $subscription->{branchcode} ne $user_branch; + $subscription->{cannotdisplay} = not can_show_subscription( $subscription ); } return @$results; -- 2.39.5