Bugzilla – Attachment 23887 Details for
Bug 7002
Inaccurate checks for borrower flags == 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7002: fix some invalid superlibrarian permission checks
Bug-7002-fix-some-invalid-superlibrarian-permissio.patch (text/plain), 3.30 KB, created by
Chris Cormack
on 2014-01-02 04:28:09 UTC
(
hide
)
Description:
Bug 7002: fix some invalid superlibrarian permission checks
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-01-02 04:28:09 UTC
Size:
3.30 KB
patch
obsolete
>From 2b33735bbed899266b2ab682c722eb3c95cbbd7f Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 30 Dec 2013 16:05:51 +0000 >Subject: [PATCH] Bug 7002: fix some invalid superlibrarian permission checks > >This patch fixes a problem where if a staff user has superlibrarian >permissions, but also has module-specific permissions, they are >prevent from editing item records that they should be allowed to. > >To test: > >[1] Turn on IndependentBranches. >[2] Register a superlibrarian staff user at branch A. >[3] Give that new account at least one other module-level > permission. This cannot be done through the user interface, > however, but can be done via SQL: > > UPDATE borrowers SET flags = 3 WHERE userid = 'XXX'; > >[4] Log in as that new superlibrarian. >[5] Bring up the item details (catalogue/moredetail.pl) page for > an item at branch B. Note that there is no 'Edit Item' link. >[6] Similarly, try editing that item (cataloging/additem.pl). Note > that the edit form forbids you from touching the item. >[7] Finally, try editing that item using the Tools | Batch item > modification utility. Note that it doesn't allow you to do so. >[8] Apply the patch. >[9] Repeat steps 5 through 7. This time, the item actions should > be allowed. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > catalogue/moredetail.pl | 2 +- > cataloguing/additem.pl | 2 +- > tools/batchMod.pl | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index a925285..91877cc 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -175,7 +175,7 @@ foreach my $item (@items){ > if (C4::Context->preference("IndependentBranches")) { > #verifying rights > my $userenv = C4::Context->userenv(); >- unless (($userenv->{'flags'} == 1) or ($userenv->{'branch'} eq $item->{'homebranch'})) { >+ unless (C4::Context->IsSuperLibrarian() or ($userenv->{'branch'} eq $item->{'homebranch'})) { > $item->{'nomod'}=1; > } > } >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 5c63aa3..268ef66 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -698,7 +698,7 @@ foreach my $field (@fields) { > if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependentBranches")) { > #verifying rights > my $userenv = C4::Context->userenv(); >- unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subfieldvalue))){ >+ unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $subfieldvalue))){ > $this_row{'nomod'} = 1; > } > } >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 5069d91..904bf2a 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -506,7 +506,7 @@ sub BuildItemsData{ > if ($itembranchcode && C4::Context->preference("IndependentBranches")) { > #verifying rights > my $userenv = C4::Context->userenv(); >- unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $itembranchcode))){ >+ unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $itembranchcode))){ > $this_row{'nomod'}=1; > } > } >-- >1.8.5.2
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 7002
:
23874
|
23887
|
23907