View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012613 | mantisbt | api soap | public | 2010-12-16 05:37 | 2011-04-05 14:23 |
Reporter | nerville | Assigned To | rombert | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | git trunk | ||||
Target Version | 1.2.5 | Fixed in Version | 1.2.5 | ||
Summary | 0012613: [patch]: Get list of subprojects ID for a specific project | ||||
Description | Please find as attachment a patch to add ability to get the list of subprojects ID for a specific project using SOAP API. Currently, the SOAP API in master-1.2.x, neither master is not providing such functions. My patch (git format) does not include PHPUnit tests. Because currently SOAP API does not offer capability to deal with hierarchy yet. My patch is for master branch. | ||||
Tags | patch | ||||
Attached Files | api.soap.feature-get.subprojects.id-git.patch (2,199 bytes)
From b29556ed579f1ae515310e7e9827418179c54918 Mon Sep 17 00:00:00 2001 From: Franck Villaume <franck.villaume@capgemini.com> Date: Thu, 16 Dec 2010 11:25:59 +0100 Subject: [PATCH] new feature: get all subprojects Id of a specific project using SOAP API --- api/soap/mantisconnect.php | 19 +++++++++++++++++-- api/soap/mc_project_api.php | 9 +++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/api/soap/mantisconnect.php b/api/soap/mantisconnect.php index 540e888..cfb5ea7 100644 --- a/api/soap/mantisconnect.php +++ b/api/soap/mantisconnect.php @@ -1269,8 +1269,7 @@ $l_oServer->register( 'mc_project_get_attachments', 'Get the attachments that belong to the specified project.' ); -## mc_project_get_custom_fields -### mc_project_get_unreleased_versions +### mc_project_get_custom_fields $l_oServer->register( 'mc_project_get_custom_fields', array( 'username' => 'xsd:string', @@ -1335,6 +1334,22 @@ $l_oServer->register( 'mc_project_attachment_delete', 'Delete the project attachment with the specified id.' ); +### mc_project_get_subprojects +$l_oServer->register( 'mc_project_get_all_subprojects', + array( + 'username' => 'xsd:string', + 'password' => 'xsd:string', + 'project_id' => 'xsd:integer' + ), + array( + 'return' => 'tns:StringArray' + ), + $t_namespace, + false, false, false, + 'Get the subprojects ID of a specific project.' +); + + ### ### PUBLIC METHODS (defined in mc_filter_api.php) ### diff --git a/api/soap/mc_project_api.php b/api/soap/mc_project_api.php index ff1f6dd..837ea73 100644 --- a/api/soap/mc_project_api.php +++ b/api/soap/mc_project_api.php @@ -639,6 +639,15 @@ function mc_project_get_attachments( $p_username, $p_password, $p_project_id ) { return $t_result; } +function mc_project_get_all_subprojects( $p_username, $p_password, $p_project_id ) { + $t_user_id = mci_check_login( $p_username, $p_password ); + + if( $t_user_id === false ) { + return new soap_fault( 'Client', '', 'Access Denied' ); + } + return project_hierarchy_get_all_subprojects($p_project_id); +} + /** * Get a project definition. * -- 1.7.3 | ||||
Thanks for the patch. Does the patch check if the user has access to see those projects? As for tests, you could add at least a call to check that a call to the hierarchy returns just the project itself ( or no project, not sure what the current semantics are ). |
|
The patch use project_hierarchy_get_all_subprojects. About tests, I will follow your advice. |
|
user_get_all_accessible_subprojects looks fine to me. Please also check if the project exists and if the user has readonly soap access. |
|
why readonly soap access ? |
|
New patch uploaded including :
|
|
There is a check about SOAP readonly access, usually done in all other calls. This happens since there is a global access level which is enforced by the SOAP API. |
|
any update on this topic. My last patch should include all fixes needed. |
|
Sorry for not picking it up, but I'm really short on time right now. I will give it high priority when I have the time to process MantisBT patches. |
|
MantisBT: master-1.2.x d8d14a69 2010-12-16 05:25 Committer: rombert Details Diff |
New feature: get all subprojects Id of a specific project using SOAP API Fixes 0012613 : Get list of subprojects ID for a specific project Signed-off-by: Robert Munteanu <robert.munteanu@gmail.com> |
Affected Issues 0012613 |
|
mod - api/soap/mc_project_api.php | Diff File | ||
mod - tests/soap/ProjectTest.php | Diff File | ||
mod - api/soap/mantisconnect.php | Diff File | ||
MantisBT: master d8864797 2010-12-16 05:25 Committer: rombert Details Diff |
New feature: get all subprojects Id of a specific project using SOAP API Fixes 0012613 : Get list of subprojects ID for a specific project Signed-off-by: Robert Munteanu <robert.munteanu@gmail.com> |
Affected Issues 0012613 |
|
mod - tests/soap/ProjectTest.php | Diff File | ||
mod - api/soap/mc_project_api.php | Diff File | ||
mod - api/soap/mantisconnect.php | Diff File |