Bugzilla – Attachment 83687 Details for
Bug 22071
authenticate_api_request does not stash koha.user in the OAuth use case
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22071: Make authenticate_api_request stash koha.user in OAuth use case
Bug-22071-Make-authenticateapirequest-stash-kohaus.patch (text/plain), 1.37 KB, created by
Martin Renvoize (ashimema)
on 2019-01-07 14:16:31 UTC
(
hide
)
Description:
Bug 22071: Make authenticate_api_request stash koha.user in OAuth use case
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-01-07 14:16:31 UTC
Size:
1.37 KB
patch
obsolete
>From 43785662019573d97b975d6ab84533b799a16eab Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 4 Jan 2019 12:46:37 -0300 >Subject: [PATCH] Bug 22071: Make authenticate_api_request stash koha.user in > OAuth use case > >This patch makes the OAuth code stash the requestion Koha::Patron. > >To test: >- Apply the tests patch: >- Run: > $ kshell > k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t >=> FAIL: Tests fail :-( >- Apply this patch >- Run: > k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t >=> SUCCESS: Tests pass :-D >- Sign off =D > >Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Auth.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm >index afbe468288..aed9e2f4fa 100644 >--- a/Koha/REST/V1/Auth.pm >+++ b/Koha/REST/V1/Auth.pm >@@ -140,6 +140,8 @@ sub authenticate_api_request { > if ($valid_token) { > my $patron_id = Koha::ApiKeys->find( $valid_token->{client_id} )->patron_id; > my $patron = Koha::Patrons->find($patron_id); >+ $c->stash('koha.user' => $patron); >+ > my $permissions = $authorization->{'permissions'}; > # Check if the patron is authorized > if ( haspermission($patron->userid, $permissions) >-- >2.19.2
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 22071
:
83638
|
83639
|
83641
|
83642
|
83651
|
83652
|
83676
|
83677
|
83686
| 83687 |
83688
|
83689