From c2015c710355a0ab81306515a70af29e6aef3504 Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Tue, 6 Sep 2011 13:00:51 -0500 Subject: [PATCH] Bug 6841 - A member with cataloging permissions cannot change branches (when independent branches is set on) This patch does a couple of things. 1. Changes permission over all to set branch printer (change branch/Set Library) from "circulation" privileges to "view catalogue" permissions. Reasoning: anyone who has privileges to view catalogue could reasonably be expected to perhaps need to change the set branch, but you might have people who don't have circulate permissions who need to change the branch, centralized cataloguing, for example. Those people would never circ and wouldn't need circ privileges, but *would* need to be able to change the set branch. 2. Changes the template flags to see the "Set Library" link with independent branches set from "manage users" to "manage users or edit catalogue." Reasoning: even with indy branches on, there might be reasons for catalogers to be able to change the set branch (that reason was the impetus for this patch in the first place). To test: Create a user with only "View Catalogue" Permissions (no circulate permissions), that user should be able to change set library with Independent branches OFF. With independent branches on, give a user edit catalogue permissions. That user should be able to change set library. I want to add that this patch was specifically written in response to chris_n's bug report. It may not be practical for these changes to be in mainline, but I haven't thought of any reasons why it would be explicitly bad. That doesn't mean there aren't some, though. Signed-off-by: Chris Nighswonger Signed-off-by: Chris Cormack --- circ/selectbranchprinter.pl | 3 ++- koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl index 5ec6c11025..b5adcfc9ce 100755 --- a/circ/selectbranchprinter.pl +++ b/circ/selectbranchprinter.pl @@ -31,13 +31,14 @@ use C4::Branch; # GetBranches GetBranchesLoop # this will be the script that chooses branch and printer settings.... my $query = CGI->new(); + my ( $template, $borrowernumber, $cookie ) = get_template_and_user({ template_name => "circ/selectbranchprinter.tmpl", query => $query, type => "intranet", debug => 1, authnotrequired => 0, - flagsrequired => { circulate => "circulate_remaining_permissions" }, + flagsrequired => { catalogue => 1, }, }); my $sessionID = $query->cookie("CGISESSID"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 58430fca26..1faf0ca712 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -52,7 +52,7 @@ [% ELSE %] [% LoginBranchname %] [% IF ( IndependantBranches ) %] - [% IF ( CAN_user_management ) %] + [% IF ( CAN_user_management || CAN_user_editcatalogue_edit_catalogue ) %] (Set library) [% END %] [% ELSE %] -- 2.39.5