Bug 30624: (QA follow-up) Use C4:Context to get permissions
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
1b6cd0c703
commit
28b629b502
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue