[API] Problem mc_issue_add and user permissions

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
yrsone
Posts: 3
Joined: 19 Oct 2010, 15:58

[API] Problem mc_issue_add and user permissions

Post by yrsone »

Hello,

I am trying to use the Mantis API and i have a problem with mc_issue_add.

If i use this function with an user who is "reporter" or "updater" on this project, the issue is created.

If i use this function with an user who is "developer", "manager" or "administrator" on this project, the function fails with this error :

Code: Select all

Fatal error: Uncaught SoapFault exception: [Server] Error Type: APPLICATION ERROR #13, Error Description: Access Denied., Stack Trace: bug_api.php L168 trigger_error(<string>'13', <integer>256) mc_issue_api.php L633 __set(<string>'target_version', <string>'') UnknownFile L? mc_issue_add(<string>'...', <string>'...', <Array> { ['project'] => <Array> { ['id'] => 1 }, ...
I have a problem with the field "target_version".

The problem seems to be here (in mc_issue_api.php) :

Code: Select all

if( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_bug_data->project_id, $t_user_id ) ) {
	$t_bug_data->target_version = isset( $p_issue['target_version'] ) ? $p_issue['target_version'] : '';
}
Issue created if commented ...

How can i resolve my problem (instead of commented source code) ?
akramfares
Posts: 2
Joined: 06 Jan 2016, 14:14

Re: [API] Problem mc_issue_add and user permissions

Post by akramfares »

Hello,

I know this question is old, but is anyone know how to solve it without commenting the line ?

Thank's
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: [API] Problem mc_issue_add and user permissions

Post by atrol »

Does changing the three lines

from

Code: Select all

	if( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_bug_data->project_id, $t_user_id ) ) {
		$t_bug_data->target_version = isset( $p_issue['target_version'] ) ? $p_issue['target_version'] : '';
	}
to

Code: Select all

	if( isset( $p_issue['target_version'] ) && access_has_project_level( config_get( 'roadmap_update_threshold', $t_bug_data->project_id, $t_user_id ) ) ) {
		$t_bug_data->target_version = $p_issue['target_version'];
	} 
fix the issue?
Please use Search before posting and read the Manual
akramfares
Posts: 2
Joined: 06 Jan 2016, 14:14

Re: [API] Problem mc_issue_add and user permissions

Post by akramfares »

I don't have access to the source code ...
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: [API] Problem mc_issue_add and user permissions

Post by atrol »

Did you change default setting (DEVELOPER) of config option $g_roadmap_update_threshold?
Please use Search before posting and read the Manual
Post Reply