Bugzilla – Attachment 106160 Details for
Bug 23634
Privilege escalation vulnerability for staff users with 'edit_borrowers' permission and 'OpacResetPassword' enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23634: Add tests for is_superlibrarian
Bug-23634-Add-tests-for-issuperlibrarian.patch (text/plain), 1.39 KB, created by
Martin Renvoize (ashimema)
on 2020-06-22 11:42:35 UTC
(
hide
)
Description:
Bug 23634: Add tests for is_superlibrarian
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-06-22 11:42:35 UTC
Size:
1.39 KB
patch
obsolete
>From f3d80eee8f092df18c643e1a705b7710a5a9c907 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 19 Nov 2019 13:22:18 -0300 >Subject: [PATCH] Bug 23634: Add tests for is_superlibrarian > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Patron.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 63b77c1573..6cf5160cbf 100644 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::Exception; > > use Koha::Database; >@@ -192,3 +192,26 @@ subtest 'to_api() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'is_superlibrarian() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ flags => 16 >+ } >+ } >+ ); >+ >+ ok( !$patron->is_superlibrarian, 'Patron is not a superlibrarian and the method returns the correct value' ); >+ >+ $patron->flags(1)->store->discard_changes; >+ ok( $patron->is_superlibrarian, 'Patron is a superlibrarian and the method returns the correct value' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.20.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 23634
:
92932
|
92998
|
95563
|
95564
|
95574
|
95575
|
95576
|
95577
|
95582
|
97986
|
97987
|
97988
|
97989
|
97990
|
106159
|
106160
|
106161
|
106162
|
106163
|
106723
|
106724
|
106725
|
106726
|
106727
|
106764
|
106826
|
106837
|
106838
|
106839
|
106840
|
106841
|
106842
|
106843
|
106844
|
106979
|
106980
|
106981
|
106982
|
106983
|
106984
|
106985
|
106986
|
109582