Bugzilla – Attachment 79781 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.53 KB, created by
Josef Moravec
on 2018-10-01 20:17:06 UTC
(
hide
)
Description:
Bug 15520: Rename permission to manage_circ_rules_from_any_libraries
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-10-01 20:17:06 UTC
Size:
4.53 KB
patch
obsolete
>From e1b43fd680b8faaac0bafed603f55c2f4b96fb4b 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 > >Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > 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 3cbcf82..f78302c 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -62,10 +62,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 830f4fb..c7e99ce 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 18fe3f8..ae45a57 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -7,7 +7,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'), > ( 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 baf966a..4127bff 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 'manage_checkout_notes' %]<span>Mark checkout notes as seen/not seen</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.1.4
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