Skip to content

Commit

Permalink
API: Use due_date access check based on project
Browse files Browse the repository at this point in the history
When creating/updating issues, check user project access level rather than global.
  • Loading branch information
vboctor committed Apr 23, 2017
1 parent 7b3126f commit 309c66d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/soap/mc_issue_api.php
Expand Up @@ -761,7 +761,8 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
$t_bug_data->sticky = $p_issue['sticky'];
}

if( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) {
if( isset( $p_issue['due_date'] ) &&
access_has_project_level( config_get( 'due_date_update_threshold' ), $t_bug_data->project_id ) ) {
$t_bug_data->due_date = strtotime( $p_issue['due_date'] );
} else {
$t_bug_data->due_date = date_get_null();
Expand Down Expand Up @@ -1007,7 +1008,8 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, stdClass $p_iss
$t_bug_data->sticky = $p_issue['sticky'];
}

if( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) {
if( isset( $p_issue['due_date'] ) &&
access_has_project_level( config_get( 'due_date_update_threshold' ), $t_bug_data->project_id ) ) {
$t_bug_data->due_date = strtotime( $p_issue['due_date'] );
} else {
$t_bug_data->due_date = date_get_null();
Expand Down

0 comments on commit 309c66d

Please sign in to comment.