Bugzilla – Attachment 77203 Details for
Bug 15520
Add more granular permission for only editing own library's circ rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15520: Rename permission to manage_circ_rules_from_any_libraries
Bug-15520-Rename-permission-to-managecircrulesfrom.patch (text/plain), 4.49 KB, created by
Jonathan Druart
on 2018-07-23 22:15:40 UTC
(
hide
)
Description:
Bug 15520: Rename permission to manage_circ_rules_from_any_libraries
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-23 22:15:40 UTC
Size:
4.49 KB
patch
obsolete
>From 2935300bdc37cd6635133e8913ca7c94a88f274e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Jul 2018 19:11:59 -0300 >Subject: [PATCH] Bug 15520: Rename permission to > manage_circ_rules_from_any_libraries > >--- > admin/smart-rules.pl | 9 +++++---- > .../atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql | 2 +- > installer/data/mysql/userpermissions.sql | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 2 +- > 4 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index e425d8230b..b593f60106 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -61,10 +61,11 @@ unless ( $branch ) { > } > } > >-my $uid = Koha::Patrons->find( $loggedinuser )->userid; >-my $restricted_to_own_library = $uid && haspermission( $uid, { parameters => 'manage_circ_rules_restricted' }, { no_inherit => 1 } ); >-$template->param( restricted_to_own_library => $restricted_to_own_library ); >-$branch = C4::Context::mybranch() if $restricted_to_own_library; >+my $logged_in_patron = Koha::Patrons->find( $loggedinuser ); >+ >+my $can_edit_from_any_library = $logged_in_patron->has_permission( {parameters => 'manage_circ_rules_from_any_libraries' } ); >+$template->param( restricted_to_own_library => not $can_edit_from_any_library ); >+$branch = C4::Context::mybranch() unless $can_edit_from_any_library; > > $branch = '*' if $branch eq 'NO_LIBRARY_SET'; > >diff --git a/installer/data/mysql/atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql b/installer/data/mysql/atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql >index 830f4fb0aa..c7e99ceb3d 100644 >--- a/installer/data/mysql/atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql >+++ b/installer/data/mysql/atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql >@@ -1 +1 @@ >-INSERT IGNORE INTO `permissions` (module_bit, code, description) VALUES(3, 'manage_circ_rules_restricted', 'Only manage circ rules for own library'); >+INSERT IGNORE INTO `permissions` (module_bit, code, description) VALUES(3, 'manage_circ_rules_from_any_libraries', 'Manage circ rules for any libraries'); >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index df025a92d4..b1d8932d85 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -6,7 +6,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), > ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), > ( 3, 'manage_circ_rules', 'Manage circulation rules'), >- ( 3, 'manage_circ_rules_restricted', 'Only manage circ rules for own library'), >+ ( 3, 'manage_circ_rules_restricted', 'Manage circ rules for any libraries'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), > ( 6, 'place_holds', 'Place holds for patrons'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 3fa7105e8a..1a4d71c85f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -33,7 +33,7 @@ > [%- CASE 'override_renewals' -%]<span>Override blocked renewals</span> > [%- CASE 'self_checkout' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span> > [%- CASE 'manage_circ_rules' -%]<span>Manage circulation rules</span> >- [%- CASE 'manage_circ_rules_restricted' -%]<span>Limit circulation rules editing to the user's own library (please note that manage_circ_rules is still required)</span> >+ [%- CASE 'manage_circ_rules_from_any_libraries' -%]<span>Edit circulation rules from any libraries. If not set the logged in user could only edit circulation rules for its the own library (please note that manage_circ_rules is still required)</span> > [%- CASE 'parameters_remaining_permissions' -%]<span>Remaining system parameters permissions</span> > [%- CASE 'edit_borrowers' -%]<span>Add, modify and view patron information</span> > [%- CASE 'view_borrower_infos_from_any_libraries' -%]<span>View patron infos from any libraries. If not set the logged in user could only access patron infos from its own library or group of libraries.</span> >-- >2.11.0
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 15520
:
66681
|
67177
|
70387
|
72240
|
72241
|
77202
|
77203
|
77219
|
77220
|
78275
|
78276
|
78722
|
78723
|
78735
|
78736
|
79780
|
79781
|
79782