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

(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 7-12 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
7
   ( 1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'),
7
   ( 1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'),
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
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
11
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
11
   ( 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'),
12
   ( 6, 'place_holds', 'Place holds for patrons'),
13
   ( 6, 'place_holds', 'Place holds for patrons'),
(-)a/t/db_dependent/Auth/haspermission.t (-2 / +15 lines)
Lines 20-26 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use Test::More tests => 13;
23
use Test::More tests => 14;
24
24
25
use Koha::Database;
25
use Koha::Database;
26
use t::lib::TestBuilder;
26
use t::lib::TestBuilder;
Lines 104-108 $r = haspermission( $borr2->{userid}, { Link Here
104
});
104
});
105
is( ref($r), 'HASH', 'Borrower2/tools granular two upload subperms' );
105
is( ref($r), 'HASH', 'Borrower2/tools granular two upload subperms' );
106
106
107
subtest 'no_inherit' => sub {
108
    $r = haspermission( $borr1->{userid}, { circulate => 'override_renewals' }, { no_inherit => 1 } );
109
    is( $r, 0, 'checking specific permission when only has superlibrarian should fail' );
110
111
    $r = haspermission( $borr2->{userid}, { parameters => 'parameters_remaining_permissions' }, { no_inherit => 1 } );
112
    is( $r, 0, 'checking specific permission when doesn\'t even have module permission should fail' );
113
114
    $r = haspermission( $borr2->{userid}, { circulate => 'override_renewals' }, { no_inherit => 1 } );
115
    is( $r, 0, 'checking specific permission when only has module permission should fail' );
116
117
    $r = haspermission( $borr2->{userid}, { tools => 'upload_local_cover_images' }, { no_inherit => 1 } );
118
    is( ref($r), 'HASH', 'checking specific permission when user has specifically that should succeed' );
119
};
120
107
# End
121
# End
108
$schema->storage->txn_rollback;
122
$schema->storage->txn_rollback;
109
- 

Return to bug 15520