From 9b50cec4b181ec553f740e4b788a2a1729167938 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Mon, 9 Jan 2012 18:43:39 +0100 Subject: [PATCH] Allow Reporters to Clone issues Previously, users needed to have update_bug_threshold to be able to clone issues, since the creation of a relationship with the parent bug requires to update it. This patch lets Reporters clone issues, but disables the "Relationship with the parent issue" field in bug_report_page.php when the user does not have updater access to the parent bug. Fixes #11290 --- bug_report_page.php | 9 +++------ core/html_api.php | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bug_report_page.php b/bug_report_page.php index c1b5252..494a144 100644 --- a/bug_report_page.php +++ b/bug_report_page.php @@ -55,9 +55,6 @@ $t_bug = bug_get( $f_master_bug_id, true ); - # the user can at least update the master bug (needed to add the relationship)... - access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_bug->project_id ), $f_master_bug_id ); - #@@@ (thraxisp) Note that the master bug is cloned into the same project as the master, independent of # what the current project is set to. if( $t_bug->project_id != helper_get_current_project() ) { @@ -210,7 +207,7 @@ @@ -226,7 +223,7 @@ > @@ -510,7 +507,7 @@ 0 ) { + if( $f_master_bug_id > 0 && access_has_bug_level( config_get( 'update_bug_threshold' ), $f_master_bug_id ) ) { ?> > diff --git a/core/html_api.php b/core/html_api.php index ee239bb..0bbcbb3 100644 --- a/core/html_api.php +++ b/core/html_api.php @@ -1514,12 +1514,12 @@ function html_button_bug_move( $p_bug_id ) { } /** - * Print a button to move the given bug to a different project + * Print a button to clone the given bug * @param int $p_bug_id * @return null */ function html_button_bug_create_child( $p_bug_id ) { - if( access_has_bug_level( config_get( 'update_bug_threshold' ), $p_bug_id ) ) { + if( access_has_bug_level( config_get( 'report_bug_threshold' ), $p_bug_id ) ) { html_button( string_get_bug_report_url(), lang_get( 'create_child_bug_button' ), array( 'm_id' => $p_bug_id ) ); } } -- 1.7.5.4