From 4bc92169dcc04cd0bd586abf01828331711980cc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Apr 2017 17:45:30 -0300 Subject: [PATCH] Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' Test plan: Login with a patron that only have the 'edit_borrowers' permission. You should be able to access patron's information of patrons inside of your group. Technical note: Before this patchset the borrowers permission module contains only 1 permission 'edit_borrowers'. That meant borrowers => 1 and borrowers => '*' had the same behavior. Moreover, now that we have 2 permissions, 'CAN_user_borrowers' is set when all permissions of 'borrowers' are set. We need to update the different occurrences of these tests. Signed-off-by: Signed-off-by: Jon McGowan Signed-off-by: Jonathan Druart --- circ/add_message.pl | 2 +- circ/del_message.pl | 2 +- edithelp.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc | 4 ++-- .../prog/en/includes/borrower_debarments.inc | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 16 ++++++++-------- koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc | 4 ++-- .../intranet-tmpl/prog/en/includes/members-menu.inc | 2 +- .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 16 ++++++++-------- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 8 ++++---- koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/members/member.tt | 2 +- .../prog/en/modules/members/memberentrygen.tt | 6 +++--- labels/label-item-search.pl | 2 +- members/boraccount.pl | 2 +- members/default_messageprefs.pl | 2 +- members/deletemem.pl | 4 ++-- members/discharge.pl | 2 +- members/discharges.pl | 2 +- members/files.pl | 2 +- members/guarantor_search.pl | 2 +- members/housebound.pl | 2 +- members/mancredit.pl | 4 ++-- members/maninvoice.pl | 4 ++-- members/member-password.pl | 5 +---- members/member.pl | 2 +- members/memberentry.pl | 2 +- members/members-home.pl | 2 +- members/members-update-do.pl | 2 +- members/members-update.pl | 2 +- members/mod_debarment.pl | 2 +- members/moremember.pl | 4 ++-- members/nl-search.pl | 2 +- members/notices.pl | 2 +- members/pay.pl | 2 +- members/paycollect.pl | 2 +- members/printfeercpt.pl | 2 +- members/printinvoice.pl | 2 +- members/purchase-suggestions.pl | 2 +- members/readingrec.pl | 2 +- members/setstatus.pl | 2 +- members/statistics.pl | 2 +- members/update-child.pl | 2 +- opac/opac-overdrive-search.pl | 2 +- svc/checkouts | 2 +- svc/members/search | 2 +- 48 files changed, 76 insertions(+), 79 deletions(-) diff --git a/circ/add_message.pl b/circ/add_message.pl index 4233e9077e..67a6844c43 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -32,7 +32,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { borrowers => 1 }, + flagsrequired => { borrowers => 'edit_borrowers' }, debug => 1, } ); diff --git a/circ/del_message.pl b/circ/del_message.pl index 8dfa3d4d81..8889431943 100755 --- a/circ/del_message.pl +++ b/circ/del_message.pl @@ -32,7 +32,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { borrowers => 1 }, + flagsrequired => { borrowers => 'edit_borrowers' }, debug => 1, } ); diff --git a/edithelp.pl b/edithelp.pl index dca61b108a..a65a504194 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -49,7 +49,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( catalogue => 1, circulate => 1, parameters => 1, - borrowers => 1, + borrowers => 'edit_borrowers', permissions => 1, reserveforothers => 1, reserveforself => 1, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc index 4bce9c463e..cc1abab4c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc @@ -21,7 +21,7 @@ [% END %] - [% IF ( CAN_user_borrowers ) %] + [% IF CAN_user_borrowers_edit_borrowers %]