Skip to content

Commit 8208170

Browse files
committedJun 2, 2012
Fix #14342: mc_issue_api functions do not perform read only checks
Various SOAP functions in mc_issue_api.php did not perform checks to ensure that read only issues are unmodifiable.
1 parent 508cab0 commit 8208170

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
 

‎api/soap/mc_issue_api.php

+17-2
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ function mci_issue_get_notes( $p_issue_id ) {
342342
* of the users which should monitor this issue.
343343
*/
344344
function mci_issue_set_monitors( $p_issue_id , $p_user_id, $p_monitors ) {
345-
345+
if ( bug_is_readonly( $p_issue_id ) ) {
346+
return mci_soap_fault_access_denied( $p_user_id, "Issue '$p_issue_id' is readonly" );
347+
}
348+
346349
$t_existing_monitors = bug_get_monitors( $p_issue_id );
347350

348351
$t_monitors = array();
@@ -709,6 +712,10 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
709712
return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist." );
710713
}
711714

715+
if( bug_is_readonly( $p_issue_id ) ) {
716+
return mci_soap_fault_access_denied( $t_user_id, "Issue '$p_issue_id' is readonly" );
717+
}
718+
712719
$t_project_id = bug_get_field( $p_issue_id, 'project_id' );
713720

714721
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
@@ -917,7 +924,11 @@ function mc_issue_set_tags ( $p_username, $p_password, $p_issue_id, $p_tags ) {
917924
if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
918925
return mci_soap_fault_access_denied( $t_user_id );
919926
}
920-
927+
928+
if( bug_is_readonly( $p_issue_id ) ) {
929+
return mci_soap_fault_access_denied( $t_user_id, "Issue '$p_issue_id' is readonly" );
930+
}
931+
921932
mci_tag_set_for_issue( $p_issue_id, $p_tags, $t_user_id );
922933

923934
return true;
@@ -1050,6 +1061,10 @@ function mc_issue_note_delete( $p_username, $p_password, $p_issue_note_id ) {
10501061
return mci_soap_fault_access_denied( $t_user_id );
10511062
}
10521063

1064+
if( bug_is_readonly( $t_issue_id ) ) {
1065+
return mci_soap_fault_access_denied( $t_user_id, "Issue '$t_issue_id' is readonly" );
1066+
}
1067+
10531068
return bugnote_delete( $p_issue_note_id );
10541069
}
10551070

0 commit comments

Comments
 (0)
Please sign in to comment.