Bugzilla – Attachment 44490 Details for
Bug 14540
Move member-flags.pl to PermissionsManager to better manage permissions for testing.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14540 - Move member-flags.pl to PermissionsManager. Recover from changed userid mid-session.
Bug-14540---Move-member-flagspl-to-PermissionsMana.patch (text/plain), 1.66 KB, created by
Olli-Antti Kivilahti
on 2015-11-05 12:06:03 UTC
(
hide
)
Description:
Bug 14540 - Move member-flags.pl to PermissionsManager. Recover from changed userid mid-session.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-11-05 12:06:03 UTC
Size:
1.66 KB
patch
obsolete
>From 578f708cb557eb78bc45371bed58728fae4616f8 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 5 Nov 2015 14:05:08 +0200 >Subject: [PATCH] Bug 14540 - Move member-flags.pl to PermissionsManager. > Recover from changed userid mid-session. > >--- > C4/Auth.pm | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 179fea5..22df21a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1715,13 +1715,25 @@ sub get_user_subpermissions { > my $userid = shift; > return {} unless $userid; > >- use Koha::Auth::PermissionManager; >- my $permissionManager = Koha::Auth::PermissionManager->new(); >- my $borrowerPermissions = $permissionManager->getBorrowerPermissions($userid); #Prefetch all related tables. > my $user_perms = {}; >- foreach my $perm ( @$borrowerPermissions ) { >- $user_perms->{ $perm->getPermissionModule->module }->{ $perm->getPermission->code } = 1; >- } >+ try { >+ use Koha::Auth::PermissionManager; >+ my $permissionManager = Koha::Auth::PermissionManager->new(); >+ my $borrowerPermissions = $permissionManager->getBorrowerPermissions($userid); #Prefetch all related tables. >+ foreach my $perm ( @$borrowerPermissions ) { >+ $user_perms->{ $perm->getPermissionModule->module }->{ $perm->getPermission->code } = 1; >+ } >+ } catch { >+ if (blessed($_) && $_->isa('Koha::Exception::UnknownObject')) { >+ return $user_perms; >+ } >+ elsif (blessed($_)) { >+ $_->rethrow(); >+ } >+ else { >+ die $_; >+ } >+ }; > > return $user_perms; > } >-- >1.9.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 14540
:
41030
|
41051
|
41055
|
41056
|
41059
|
41062
|
41071
|
41123
|
41158
|
41255
|
41258
|
41310
|
41402
|
41535
|
42390
|
42410
|
42432
|
42434
|
42550
|
44490
|
63252
|
63253
|
63254