Bugzilla – Attachment 16462 Details for
Bug 8435
new permissions on subscriptions "superserials"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8435 [Follow-up] Check superserials permission on subscription-add
Bug-8435-Follow-up-Check-superserials-permission-o.patch (text/plain), 2.14 KB, created by
Paul Poulain
on 2013-03-20 09:33:22 UTC
(
hide
)
Description:
Bug 8435 [Follow-up] Check superserials permission on subscription-add
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2013-03-20 09:33:22 UTC
Size:
2.14 KB
patch
obsolete
>From 3c55ef568b4e0648423f3801858f95496030cb5e Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 19 Mar 2013 14:49:03 +0000 >Subject: [PATCH] Bug 8435 [Follow-up] Check superserials permission on subscription-add > >So subscription creation is now possible for other branches when you >have this permission enabled. > >Signed-off-by: Frederic Durand <frederic.durand@unilim.fr> >--- > installer/data/mysql/updatedatabase.pl | 2 +- > serials/subscription-add.pl | 14 ++++++++++---- > 2 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 273836c..6b7e9c3 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6532,7 +6532,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >-$DBversion = "3.09.00.XXX"; >+$DBversion = "XXX"; > if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES(15, 'superserials', 'Manage subscriptions from any branch')"); > print "Upgrade to $DBversion done (Add superserials permission)\n"; >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 39efa9e..9a42468 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -121,10 +121,16 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { > } > } > >-my $onlymine=C4::Context->preference('IndependantBranches') && >- C4::Context->userenv && >- C4::Context->userenv->{flags} % 2 !=1 && >- C4::Context->userenv->{branch}; >+my $userenv = C4::Context->userenv; >+my $onlymine = >+ C4::Context->preference('IndependantBranches') >+ && $userenv >+ && $userenv->{flags} % 2 != 1 >+ && ( >+ not C4::Auth::haspermission( $userenv->{id}, { serials => 'superserials' } ) >+ ) >+ && $userenv->{branch}; >+ > my $branches = GetBranches($onlymine); > my $branchloop; > for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %{$branches}) { >-- >1.7.2.5
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 8435
:
10821
|
11377
|
11411
|
11892
|
13396
|
15673
|
16404
|
16462
|
16740
|
16750
|
16751
|
16798
|
16799
|
16801
|
16802
|
16803
|
16943
|
16944
|
19260
|
19261
|
19266
|
19268
|
20536
|
21286
|
21287
|
21288
|
21289
|
22624
|
22625
|
22626
|
22627
|
22628