View | Details | Raw Unified | Return to bug 15520
Collapse All | Expand All

(-)a/admin/smart-rules.pl (-4 / +5 lines)
Lines 61-70 unless ( $branch ) { Link Here
61
    }
61
    }
62
}
62
}
63
63
64
my $uid = Koha::Patrons->find( $loggedinuser )->userid;
64
my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
65
my $restricted_to_own_library = $uid && haspermission( $uid, { parameters => 'manage_circ_rules_restricted' }, { no_inherit => 1 } );
65
66
$template->param( restricted_to_own_library => $restricted_to_own_library );
66
my $can_edit_from_any_library = $logged_in_patron->has_permission( {parameters => 'manage_circ_rules_from_any_libraries' } );
67
$branch = C4::Context::mybranch() if $restricted_to_own_library;
67
$template->param( restricted_to_own_library => not $can_edit_from_any_library );
68
$branch = C4::Context::mybranch() unless $can_edit_from_any_library;
68
69
69
$branch = '*' if $branch eq 'NO_LIBRARY_SET';
70
$branch = '*' if $branch eq 'NO_LIBRARY_SET';
70
71
(-)a/installer/data/mysql/atomicupdate/bug_15520-add_manage_circ_rules_restricted.sql (-1 / +1 lines)
Line 1 Link Here
1
INSERT IGNORE INTO `permissions` (module_bit, code, description) VALUES(3, 'manage_circ_rules_restricted', 'Only manage circ rules for own library');
1
INSERT IGNORE INTO `permissions` (module_bit, code, description) VALUES(3, 'manage_circ_rules_from_any_libraries', 'Manage circ rules for any libraries');
(-)a/installer/data/mysql/userpermissions.sql (-1 / +1 lines)
Lines 7-13 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
7
   ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'),
7
   ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'),
8
   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
8
   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
9
   ( 3, 'manage_circ_rules', 'Manage circulation rules'),
9
   ( 3, 'manage_circ_rules', 'Manage circulation rules'),
10
   ( 3, 'manage_circ_rules_restricted', 'Only manage circ rules for own library'),
10
   ( 3, 'manage_circ_rules_restricted', 'Manage circ rules for any libraries'),
11
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
11
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
12
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
12
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
13
   ( 6, 'place_holds', 'Place holds for patrons'),
13
   ( 6, 'place_holds', 'Place holds for patrons'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (-2 / +1 lines)
Lines 33-39 Link Here
33
    [%- CASE 'override_renewals' -%]<span>Override blocked renewals</span>
33
    [%- CASE 'override_renewals' -%]<span>Override blocked renewals</span>
34
    [%- CASE 'manage_checkout_notes' %]<span>Mark checkout notes as seen/not seen</span>
34
    [%- CASE 'manage_checkout_notes' %]<span>Mark checkout notes as seen/not seen</span>
35
    [%- CASE 'manage_circ_rules' -%]<span>manage circulation rules</span>
35
    [%- CASE 'manage_circ_rules' -%]<span>manage circulation rules</span>
36
    [%- 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>
36
    [%- 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>
37
    [%- CASE 'parameters_remaining_permissions' -%]<span>Remaining system parameters permissions</span>
37
    [%- CASE 'parameters_remaining_permissions' -%]<span>Remaining system parameters permissions</span>
38
    [%- CASE 'edit_borrowers' -%]<span>Add, modify and view patron information</span>
38
    [%- CASE 'edit_borrowers' -%]<span>Add, modify and view patron information</span>
39
    [%- 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>
39
    [%- 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>
40
- 

Return to bug 15520