Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 804f6ed

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 edc8142 commit 804f6ed

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();
@@ -710,6 +713,10 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
710713
return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist." );
711714
}
712715

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

715722
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;
@@ -1046,6 +1057,10 @@ function mc_issue_note_delete( $p_username, $p_password, $p_issue_note_id ) {
10461057
}
10471058
}
10481059

1060+
if( bug_is_readonly( $t_issue_id ) ) {
1061+
return mci_soap_fault_access_denied( $t_user_id, "Issue '$t_issue_id' is readonly" );
1062+
}
1063+
10491064
return bugnote_delete( $p_issue_note_id );
10501065
}
10511066

0 commit comments

Comments
 (0)
Please sign in to comment.