From c7a50fb44cfb6068fea6e26463faab07a6a36d19 Mon Sep 17 00:00:00 2001 From: Lisette Scheer Date: Mon, 9 Sep 2024 20:12:47 +0000 Subject: [PATCH] Bug 37737: [23.11] Fixed report permissions to prevent disallowed duplication Test plan: 1. Checkout 23.11 2. Create a report 3. Create a user with staff login and run reports permissions 4. Log in as your new user 5. Preview the SQL of the report 6. In the preview modal, select Duplicate report 7. Apply patch 8. Repeat steps 4-6. 9. You should be prompted to login. --- reports/guided_reports.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index b8a99c0c8b..fad5670944 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -57,7 +57,7 @@ my $usecache = Koha::Caches->get_instance->memcached_cache; my $phase = $input->param('phase') // ''; my $flagsrequired; if ( ( $phase eq 'Build new' ) || ( $phase eq 'Create report from SQL' ) || ( $phase eq 'Edit SQL' ) - || ( $phase eq 'Build new from existing' ) ) { + || ( $phase eq 'Build new from existing' ) || ( $phase eq 'Create report from existing' ) ) { $flagsrequired = 'create_reports'; } elsif ( $phase eq 'Use saved' ) { @@ -66,6 +66,9 @@ elsif ( $phase eq 'Use saved' ) { elsif ( $phase eq 'Delete Saved' ) { $flagsrequired = 'delete_reports'; } +elsif ( $phase eq 'Run this Report') { + $flagsrequired = 'execute_reports'; +} else { $flagsrequired = '*'; } -- 2.39.2