Bugzilla – Attachment 147509 Details for
Bug 30624
Add a permission to control the ability to change the logged in library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30624: (QA follow-up) Use C4:Context to get permssions
Bug-30624-QA-follow-up-Use-C4Context-to-get-permss.patch (text/plain), 2.22 KB, created by
Lucas Gass (lukeg)
on 2023-02-28 17:06:46 UTC
(
hide
)
Description:
Bug 30624: (QA follow-up) Use C4:Context to get permssions
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-02-28 17:06:46 UTC
Size:
2.22 KB
patch
obsolete
>From ef638fcaf38e2c6c64ce8c9fabe9259bb0264ace Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 28 Feb 2023 17:04:52 +0000 >Subject: [PATCH] Bug 30624: (QA follow-up) Use C4:Context to get permssions > >--- > circ/set-library.pl | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/circ/set-library.pl b/circ/set-library.pl >index 35261a5006..06b171c75b 100755 >--- a/circ/set-library.pl >+++ b/circ/set-library.pl >@@ -22,7 +22,7 @@ use CGI qw ( -utf8 ); > > use C4::Context; > use C4::Output qw( output_html_with_http_headers ); >-use C4::Auth qw( get_template_and_user get_session ); >+use C4::Auth qw( get_template_and_user get_session haspermission ); > use Koha::BiblioFrameworks; > use Koha::Cash::Registers; > use Koha::Libraries; >@@ -49,7 +49,7 @@ my $userenv_register_id = C4::Context->userenv->{'register_id'} || ''; > my @updated; > > # $session lines here are doing the updating >-if ( $branch and my $library = Koha::Libraries->find($branch) and ( $flags->{loggedinlibrary} == 1 or $flags->{superlibrarian} == 1 ) ) { >+if ( $branch and my $library = Koha::Libraries->find($branch) and ( C4::Auth::haspermission(C4::Context->userenv->{'id'}, { 'loggedinlibrary' => 1 }) or C4::Context::IsSuperLibraian() ) ) { > if ( !$userenv_branch or $userenv_branch ne $branch ) { > my $branchname = $library->branchname; > $session->param('branchname', $branchname); # update sesssion in DB >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >index 08f7397df0..9c50675708 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >@@ -90,7 +90,7 @@ Updated:<ul> > <ol> > <li><label for="branch">Choose library:</label> > <select name="branch" id="branch"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %] > </select></li> > </ol> > </fieldset> >-- >2.30.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 30624
:
136055
|
136076
|
137733
|
138377
|
138378
|
139961
|
139962
|
139963
|
141069
|
141070
|
141071
|
142269
|
142270
|
142271
|
144557
|
144559
|
144584
|
144594
|
144595
|
144596
|
145048
|
145049
|
145631
|
147509
|
147753
|
147754
|
147755
|
147756
|
148116