View Issue Details

IDProjectCategoryView StatusLast Update
0011290mantisbtfeaturepublic2015-01-15 05:10
ReporterRoboDoc 
Assigned Todregad 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0011290: Create Clone access to reporters
Description

Users with "reporter" access can submit issues.

It would be great if these users also could use the "Create Clone" feature, instead of having to open XX "Report Issue"-forms, copy & paste data from a previously submitted issue, just to make a similar (but not identical), new issue.

TagsNo tags attached.

Relationships

has duplicate 0013323 closeddregad Add the option to be able to link to read-only tickets 
related to 0018018 closeddregad Backport feature "Create Clone access to reporters" to 1.2.x series 

Activities

RoboDoc

RoboDoc

2009-12-16 08:11

reporter   ~0023915

This would be VERY useful for "repetitive work"-purposes, e.g.

Parent: "Update BIND on all name servers"
- CHILD1: "ns1.mydomain.net - Update BIND" - CHILD2: "ns2.mydomain.net - Update BIND"
`- CHILD3: "ns3.mydomain.net - Update BIND"

And yes; we use MantisBT for other stuff than code bugtracking, as well; [simple] project management, systems maintenance, logistics, tracking non-code-related bugs, etc. :-)

RoboDoc

RoboDoc

2009-12-16 08:59

reporter   ~0023917

It seems that UPDATER access is needed (re. "update_bug_threshold"), but it should be sufficient with REPORTER access for this operation.

dregad

dregad

2012-01-09 12:17

developer   ~0030882

Last edited: 2012-05-23 05:59

View 3 revisions

This behavior is by design, as cloning an issue will allow the user to create a relationship to the parent issue, which will be updated by doing so.

That being said, your suggestion makes sense. Please consider these 2 alternatives:

  1. Allow Reporters to clone issues

In that case, to be consistent with access rights, the "Relationship with the parent issue" field in bug_report_page.php should be disabled when the user does not have updater access to the parent bug.

See attached: 11290-allow-reporter-close-option1-v2.patch

  1. Create a new config option $g_clone_bug_threshold

With that new setup, we could treat the bug cloning as a special case in which it is acceptable for a Reporter to update a bug they would normally not be allowed to change; however, since that change is very limited and controlled in nature (i.e. creating a new relationship), this may be acceptable.

I recommend to go for option 1, which is more respectful of the access rights. Please test and let me know your thoughts.

If you think option 2 is necessary, I'll bounce it off the other devs to see what they think.

EDIT: revised patch (old one was missing modification of access check in bug_report.php)

dregad

dregad

2012-01-09 12:49

developer  

0001-Allow-Reporters-to-Clone-issues.patch (2,549 bytes)
From 9b50cec4b181ec553f740e4b788a2a1729167938 Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckgroup.com>
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 @@
 	</tr>
 <?php
 	}
-	
+
 	if ( $tpl_show_eta ) {
 ?>
 
@@ -226,7 +223,7 @@
 	</tr>
 <?php
 	}
-	
+
 	if ( $tpl_show_severity ) {
 ?>
 	<tr <?php echo helper_alternate_class() ?>>
@@ -510,7 +507,7 @@
 		</td>
 	</tr>
 <?php //Relationship (in case of cloned bug creation...)
-	if( $f_master_bug_id > 0 ) {
+	if( $f_master_bug_id > 0 && access_has_bug_level( config_get( 'update_bug_threshold' ), $f_master_bug_id ) ) {
 ?>
 	<tr <?php echo helper_alternate_class() ?>>
 		<td class="category">
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

vincent_sels

vincent_sels

2012-01-12 17:07

reporter   ~0030898

Last edited: 2012-05-23 16:03

Pretty much a duplicate of one of my tickets: 0013323. The solution I went for is more like your option 2.

dregad

dregad

2012-05-23 05:58

developer   ~0031884

Following a discussion on the mailing list [1] a new option was identified

  1. Allow a user without update_bug_threshold to add relationship to parent

Even though strictly speaking that should be considered as an update of the parent bug, this would probably be acceptable in the limited context of cloning and would avoid adding a new config option.

[1] http://thread.gmane.org/gmane.comp.bug-tracking.mantis.devel/3799

dregad

dregad

2012-05-23 05:58

developer  

11290-allow-reporter-close-option1-v2.patch (3,508 bytes)
diff --git a/bug_report.php b/bug_report.php
index e451ff8..b3617be 100644
--- a/bug_report.php
+++ b/bug_report.php
@@ -35,7 +35,10 @@
 	form_security_validate( 'bug_report' );
 
 	$t_project_id = null;
+
 	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
+	$f_rel_type      = gpc_get_int( 'rel_type', BUG_REL_NONE );
+
 	if ( $f_master_bug_id > 0 ) {
 		bug_ensure_exists( $f_master_bug_id );
 		if ( bug_is_readonly( $f_master_bug_id ) ) {
@@ -43,9 +46,9 @@
 			trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
 		}
 		$t_master_bug = bug_get( $f_master_bug_id, true );
-		project_ensure_exists( $t_master_bug->project_id );
-		access_ensure_bug_level( config_get( 'update_bug_threshold', null, null, $t_master_bug->project_id ), $f_master_bug_id );
 		$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 );
@@ -168,9 +171,6 @@
 		}
 	}
 
-	$f_master_bug_id = gpc_get_int( 'm_id', 0 );
-	$f_rel_type = gpc_get_int( 'rel_type', -1 );
-
 	if ( $f_master_bug_id > 0 ) {
 		# it's a child generation... let's create the relationship and add some lines in the history
 
@@ -181,7 +181,7 @@
 		history_log_event_special( $t_bug_id, BUG_CREATED_FROM, '', $f_master_bug_id );
 		history_log_event_special( $f_master_bug_id, BUG_CLONED_TO, '', $t_bug_id );
 
-		if ( $f_rel_type >= 0 ) {
+		if ( $f_rel_type > BUG_REL_ANY ) {
 			# Add the relationship
 			relationship_add( $t_bug_id, $f_master_bug_id, $f_rel_type );
 
diff --git a/bug_report_page.php b/bug_report_page.php
index 4108ae8..42e9cc6 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 @@
 	</tr>
 <?php
 	}
-	
+
 	if ( $tpl_show_eta ) {
 ?>
 
@@ -226,7 +223,7 @@
 	</tr>
 <?php
 	}
-	
+
 	if ( $tpl_show_severity ) {
 ?>
 	<tr <?php echo helper_alternate_class() ?>>
@@ -524,7 +521,7 @@
 		</td>
 	</tr>
 <?php //Relationship (in case of cloned bug creation...)
-	if( $f_master_bug_id > 0 ) {
+	if( $f_master_bug_id > 0 && access_has_bug_level( config_get( 'update_bug_threshold' ), $f_master_bug_id ) ) {
 ?>
 	<tr <?php echo helper_alternate_class() ?>>
 		<td class="category">
diff --git a/core/html_api.php b/core/html_api.php
index 30347c5..2be87b1 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -1517,12 +1517,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 ) );
 	}
 }
dregad

dregad

2014-02-05 09:40

developer   ~0039323

See PR

Option 2 not implemented at this stage

dregad

dregad

2014-02-13 14:31

developer   ~0039397

Implemented option 3 (Allow a user without update_bug_threshold to add relationship to parent)

Related Changesets

MantisBT: master 8aafaaf4

2014-02-05 07:51:54

dregad

Details Diff
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 0011290 (implements option 3)
mod - bug_report.php Diff File
mod - bug_report_page.php Diff File
mod - core/html_api.php Diff File

Issue History

Date Modified Username Field Change
2009-12-16 08:07 RoboDoc New Issue
2009-12-16 08:11 RoboDoc Note Added: 0023915
2009-12-16 08:59 RoboDoc Note Added: 0023917
2012-01-09 12:17 dregad Note Added: 0030882
2012-01-09 12:17 dregad Status new => acknowledged
2012-01-09 12:49 dregad File Added: 0001-Allow-Reporters-to-Clone-issues.patch
2012-01-09 12:50 dregad Note Edited: 0030882 View Revisions
2012-01-12 17:07 vincent_sels Note Added: 0030898
2012-01-13 05:22 dregad Relationship added has duplicate 0013323
2012-05-23 05:58 dregad Note Added: 0031884
2012-05-23 05:58 dregad File Added: 11290-allow-reporter-close-option1-v2.patch
2012-05-23 05:59 dregad Note Edited: 0030882 View Revisions
2014-02-05 09:40 dregad Note Added: 0039323
2014-02-05 09:47 dregad Assigned To => dregad
2014-02-05 09:47 dregad Status acknowledged => assigned
2014-02-13 12:37 dregad Changeset attached => MantisBT master 8aafaaf4
2014-02-13 12:37 dregad Status assigned => resolved
2014-02-13 12:37 dregad Resolution open => fixed
2014-02-13 12:37 dregad Fixed in Version => 1.3.0dev
2014-02-13 14:31 dregad Target Version => 1.3.0-beta.1
2014-02-13 14:31 dregad Note Added: 0039397
2014-02-13 16:08 atrol Fixed in Version 1.3.0dev => 1.3.0-beta.1
2014-12-08 00:34 vboctor Status resolved => closed
2015-01-15 05:10 dregad Relationship added related to 0018018