From abe3c44d077080bbcf07729c0c8da66f33cb32e9 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. Signed-off-by: Brendan Lawlor Signed-off-by: Nick Clemens --- 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 b8a99c0c8bd..fad56709446 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.5