Skip to content

Commit

Permalink
Expose default handler for categories for managers
Browse files Browse the repository at this point in the history
Fixes #24346
  • Loading branch information
vboctor committed Apr 28, 2018
1 parent 8758ab8 commit 021c13f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/soap/mc_project_api.php
Expand Up @@ -892,14 +892,18 @@ function mci_project_categories( $p_project_id ) {
$t_results = array();

foreach( $t_categories as $t_category ) {
$t_project_id = (int)$t_category['project_id'];
$t_result = array(
'id' => (int)$t_category['id'],
'name' => $t_category['name'],
'project' => array( 'id' => (int)$t_category['project_id'], 'name' => $t_category['project_name'] ),
'project' => array( 'id' => $t_project_id, 'name' => $t_category['project_name'] ),
);

# Do access check here to take into consider the project id that the category is associated with
# in case of inherited categories.
$t_default_handler_id = (int)$t_category['user_id'];
if( $t_default_handler_id != 0 ) {
if( $t_default_handler_id != 0 &&
access_has_project_level( config_get( 'manage_project_threshold', null, null, $t_project_id ), $t_project_id ) ) {
$t_result['default_handler'] = mci_account_get_array_by_id( $t_default_handler_id );
}

Expand Down

0 comments on commit 021c13f

Please sign in to comment.