Permalink
Browse files

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 and allows them to create a
relationship with the parent, even if they lack updater access.

Fixes #11290 (implements option 3)
  • Loading branch information...
dregad committed Feb 5, 2014
1 parent a0ae5ce commit 8aafaaf4b6c121d2c6c3d5b8494cd492a3e5cfce
Showing with 7 additions and 10 deletions.
  1. +2 −3 bug_report.php
  2. +3 −5 bug_report_page.php
  3. +2 −2 core/html_api.php
View
@@ -88,13 +88,12 @@
}
$t_master_bug = bug_get( $f_master_bug_id, true );
$t_project_id = $t_master_bug->project_id;
- project_ensure_exists( $t_project_id );
- access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_project_id ), $f_master_bug_id );
} else {
$f_project_id = gpc_get_int( 'project_id' );
- project_ensure_exists( $f_project_id );
$t_project_id = $f_project_id;
}
+project_ensure_exists( $t_project_id );
+
if ( $t_project_id != helper_get_current_project() ) {
$g_project_override = $t_project_id;
}
View
@@ -91,9 +91,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() ) {
@@ -632,9 +629,10 @@
<label><input <?php echo helper_get_tab_index() ?> type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?></label>
</td>
</tr>
- <?php
+<?php
}
- //Relationship (in case of cloned bug creation...)
+
+ # Relationship (in case of cloned bug creation...)
if( $f_master_bug_id > 0 ) {
?>
<tr>
View
@@ -1618,12 +1618,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 ) );
}
}

0 comments on commit 8aafaaf

Please sign in to comment.