Bug 34148 - mainpage.pl shows background jobs to users without manage_background_jobs permission
Summary: mainpage.pl shows background jobs to users without manage_background_jobs per...
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-28 16:45 UTC by Lucas Gass (lukeg)
Modified: 2024-07-04 20:37 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2023-06-28 16:45:09 UTC
On mainpage.pl we show the count of background jobs only to users who do not have the manage_background_jobs permission:

unless ( $logged_in_user->has_permission( { parameters => 'manage_background_jobs' } ) ) { 
    my $already_ran_jobs = Koha::BackgroundJobs->search(
        { borrowernumber => $logged_in_user->borrowernumber } )->count ? 1 : 0;
    $template->param( already_ran_jobs => $already_ran_jobs );
}


This seems backwards to me. Is there a reason to show the count only to users without the permission?
Comment 1 Lucas Gass (lukeg) 2023-06-28 17:34:03 UTC
I just saw Bug 29020. So this is working as intended.