Bugzilla – Attachment 27115 Details for
Bug 12080
Superserials permission appears to be broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0002-Bug-12080-Superserials-permission-in-search-result.patch (text/plain), 1.72 KB, created by
Frédéric Demians
on 2014-04-15 08:15:10 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2014-04-15 08:15:10 UTC
Size:
1.72 KB
patch
obsolete
>From e969c340fc217a854e64838b452383c82f751d25 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Tue, 15 Apr 2014 10:10:07 +0200 >Subject: [PATCH 2/2] Bug 12080 Superserials permission in search result > >Enabling/disabling IndependentBranch syspref & superserials >permission, you can see that serials search result doesn't display all >subscriptions when appropriate. Fixed with this patch. > >Dependency: This patch must be applied after patch for bug 12048. >--- > C4/Serials.pm | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 2b7fd51..9fc9ad8 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -736,12 +736,20 @@ 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->{'branch'}; > for my $subscription ( @$results ) { > $subscription->{cannotedit} = not can_edit_subscription( $subscription ); > $subscription->{cannotdisplay} = >- ( C4::Context->preference("IndependentBranches") && >- (!C4::Context->IsSuperLibrarian()) && >- $subscription->{branchcode} ne C4::Context->userenv->{'branch'} ) ? 1 : 0; >+ $cant_display_other_branches && >+ $subscription->{branchcode} ne $user_branch; > } > > return @$results; >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12080
:
27115
|
27135
|
27218
|
27219
|
27279
|
27284
|
27286
|
27287