From 8cd4e28ce2544131d2f4ae60e86aac56bde5c182 Mon Sep 17 00:00:00 2001
From: Fridolin Somers <fridolin.somers@biblibre.com>
Date: Tue, 4 Nov 2014 17:47:54 +0100
Subject: [PATCH] Bug 12838 - Deleting a borrower orphans that borrower's lists
Currently if any borrower has a list, and that borrower is deleted, the list is effectively abandoned and unable to be deleted until that list has been associated with an existent user.
This patch adds to a superlibrarian the ability to view/edit/delete/manage all lists.
Test plan :
- Log as not-superlibrarian user
- Go to lists module
=> You can only edit/delete your lists
- Log as superlibrarian user
- Go to lists module
=> You can do any action on any list
---
C4/VirtualShelves.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm
index 70dc965..3521fa2 100644
--- a/C4/VirtualShelves.pm
+++ b/C4/VirtualShelves.pm
@@ -454,6 +454,8 @@ sub ShelfPossibleAction {
$action= 'view' unless $action;
$user=0 unless $user;
+ return 1 if C4::Context::IsSuperLibrarian;
+
if($action =~ /^new/) { #no shelfnumber needed
if($action eq 'new_private') {
return $user>0;
--
1.9.1