Bugzilla – Attachment 72241 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: (QA follow-up) Add tests, missing installer data
Bug-15520-QA-follow-up-Add-tests-missing-installer.patch (text/plain), 2.69 KB, created by
Jesse Weaver
on 2018-02-26 19:33:41 UTC
(
hide
)
Description:
Bug 15520: (QA follow-up) Add tests, missing installer data
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2018-02-26 19:33:41 UTC
Size:
2.69 KB
patch
obsolete
>From 3de4fc9fefb88c21672257301426379b9d33e2e2 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Mon, 26 Feb 2018 12:32:56 -0700 >Subject: [PATCH] Bug 15520: (QA follow-up) Add tests, missing installer data > >--- > installer/data/mysql/userpermissions.sql | 1 + > t/db_dependent/Auth/haspermission.t | 16 +++++++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index 52adbceebf..78765a3990 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -7,6 +7,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'), > ( 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'), > ( 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/t/db_dependent/Auth/haspermission.t b/t/db_dependent/Auth/haspermission.t >index bf0290d6be..0c9c53cc0c 100644 >--- a/t/db_dependent/Auth/haspermission.t >+++ b/t/db_dependent/Auth/haspermission.t >@@ -20,7 +20,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 13; >+use Test::More tests => 14; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -104,5 +104,19 @@ $r = haspermission( $borr2->{userid}, { > }); > is( ref($r), 'HASH', 'Borrower2/tools granular two upload subperms' ); > >+subtest 'no_inherit' => sub { >+ $r = haspermission( $borr1->{userid}, { circulate => 'override_renewals' }, { no_inherit => 1 } ); >+ is( $r, 0, 'checking specific permission when only has superlibrarian should fail' ); >+ >+ $r = haspermission( $borr2->{userid}, { parameters => 'parameters_remaining_permissions' }, { no_inherit => 1 } ); >+ is( $r, 0, 'checking specific permission when doesn\'t even have module permission should fail' ); >+ >+ $r = haspermission( $borr2->{userid}, { circulate => 'override_renewals' }, { no_inherit => 1 } ); >+ is( $r, 0, 'checking specific permission when only has module permission should fail' ); >+ >+ $r = haspermission( $borr2->{userid}, { tools => 'upload_local_cover_images' }, { no_inherit => 1 } ); >+ is( ref($r), 'HASH', 'checking specific permission when user has specifically that should succeed' ); >+}; >+ > # End > $schema->storage->txn_rollback; >-- >2.15.1
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