View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012541 | mantisbt | api soap | public | 2010-11-18 12:08 | 2014-12-08 00:33 |
Reporter | dominik | Assigned To | vboctor | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.17 | ||||
Target Version | 1.3.0-beta.1 | Fixed in Version | 1.3.0-beta.1 | ||
Summary | 0012541: mc_issue_note_add function not honoring reporter data | ||||
Description | When using the function mc_issue_note_add() the submitted reporter data aren't used. The attached patch will resolve this (patch is againgst master-1.2.x)... | ||||
Tags | patch | ||||
Attached Files | mc_issue_note_add.patch (1,789 bytes)
From f6b3cefd42d0e5990794da35376dd559293f890e Mon Sep 17 00:00:00 2001 From: Dominik Blunk <dominik@blunk.ch> Date: Thu, 18 Nov 2010 17:55:21 +0100 Subject: [PATCH] Fixed mc_issue_note_add to include submitted reporter data --- api/soap/mc_issue_api.php | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/api/soap/mc_issue_api.php b/api/soap/mc_issue_api.php index f62a925..4d40985 100644 --- a/api/soap/mc_issue_api.php +++ b/api/soap/mc_issue_api.php @@ -865,9 +865,22 @@ function mc_issue_note_add( $p_username, $p_password, $p_issue_id, $p_note ) { 'id' => config_get( 'default_bug_view_status' ), ); } + $t_reporter_id = isset( $p_note['reporter'] ) ? mci_get_user_id( $p_note['reporter'] ) : 0; + if( $t_reporter_id == 0 ) { + $t_reporter_id = $t_user_id; + } else { + if( $t_reporter_id != $t_user_id ) { + + # Make sure that active user has access level required to specify a different reporter. + $t_specify_reporter_access_level = config_get( 'mc_specify_reporter_on_add_access_level_threshold' ); + if( !access_has_project_level( $t_specify_reporter_access_level, $t_project_id, $t_user_id ) ) { + return mci_soap_fault_access_denied( $t_user_id, "Active user does not have access level required to specify a different issue note reporter" ); + } + } + } $t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state ); - return bugnote_add( $p_issue_id, $p_note['text'], mci_get_time_tracking_from_note( $p_issue_id, $p_note ), $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id ); + return bugnote_add( $p_issue_id, $p_note['text'], mci_get_time_tracking_from_note( $p_issue_id, $p_note ), $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_reporter_id ); } /** -- 1.7.3.1.msysgit.0 | ||||
parent of | 0017777 | new | Add test case for mc_issue_add() and mc_issue_note_add() reporter override | |
related to | 0012412 | closed | dregad | "Reporter" should be editable by access level |
related to | 0011274 | acknowledged | mc_issue_note_add function not honoring CreationDate | |
Not all the children of this issue are yet resolved or closed. |
I agree with the principle of this patch. However the configuration value "mc_specify_reporter_on_add_access_level_threshold" needs to be more generic, such as "specify_reporter_threshold". This configuration value then needs to be added to config_defaults_inc.php and documented both there and in the docbook documentation. This functionality can then be extended/merged with 0012412 that requests the ability for people to change the reporter of an issue via the web UI. |
|
Removed assignment. dhx will not contribute to this issue in near future. |
|
Hello guys, is it planned to integrate ever? |
|
I guess it will be, someday (probably) but it is not planned at the moment. We need to consider a global patch covering also the GUI functionality (bug report page), and also applying the threshold in mc_issue_add() too. |
|
Thanks @dominik for your patch. I've submitted a pull request for this with some updates. |
|
MantisBT: master 666b56c7 2014-10-12 14:38 Committer: vboctor Details Diff |
Fix 0012541: mc_issue_note_add function not honoring reporter data When using the function mc_issue_note_add() the submitted reporter data aren't used. This fixes allows users with 'webservice_specify_reporter_on_add_access_level_threshold' access level to override reporter when submitting notes. This makes it consistent with mc_issue_add() api. |
Affected Issues 0012541 |
|
mod - api/soap/mc_issue_api.php | Diff File |