Page 1 of 1

API key of admin user works, API key of leader give error

Posted: Mon May 07, 2012 8:40 pm
by usunkad
I modified the config.inc.php file like this:

/** XML-RPC API availability (disabled by default) */
$tlCfg->api->enabled = TRUE;

// ENABLED -> enable XML-RPC calls to external test automation server
// new buttons will be displayed on execution pages
// DISABLED -> disable
$tlCfg->exec_cfg->enable_test_automation = ENABLE;

1. Created a user with leader rights and login to Testlink
2. Go to 'My Settings' Under API interface, click 'Generate new key'
Copy the key generated key in my Java code i get an error with code 2010 : User corresponding to Developer Key has insufficient rights to perform this action.

1. Created a user with admin rights and login to Testlink
2. Go to 'My Settings' Under API interface, click 'Generate new key'
Copy the key generated key in my Java code everything seems to work fine, i am able to update test results from Selenium scripts

Why does the key of admin user work ok but API key of user with Leader rights does not seem to work. This is blocking my team as we would like to update results as different users not just using Admin user. Also i don't want people in the team to have admin rights just for this.

Re: API key of admin user works, API key of leader give erro

Posted: Tue May 08, 2012 6:11 pm
by fman
You are not indicated what is the operation you want to do (i.e API call), the same restrictions that applies on GUI has to be applied via API.

Re: API key of admin user works, API key of leader give erro

Posted: Fri Jun 15, 2012 7:56 am
by RvdP2012
You could check if there is a difference in the default rights of the users and their rights on test projects / test plans. We're using the XMLRPC-interface too, and found a simular problem. Normally, when we make a new user we initially give him <no rights>. This makes access management easier, as you only have to override the users rights per project he needs access to and all other project are (by default) inaccessible.
But this way we couldn't get access through XMLRPC, even though the user had <leader> rights on the project. Once we changed the default rights for this user to (e.g.) <leader>, then he got access through XMLRPC. We're still analyzing why this is happening.

Re: API key of admin user works, API key of leader give erro

Posted: Fri Jun 15, 2012 9:56 am
by fman
please open issue on mantis, is only way dev team can do planning.
May be issue is due to missing management of private/public concept on API methods

Re: API key of admin user works, API key of leader give erro

Posted: Fri Jun 15, 2012 11:32 am
by RvdP2012
OK, I'll do so. Just tried to provide a possible workaround (which works for us).

Re: API key of admin user works, API key of leader give erro

Posted: Fri Jun 15, 2012 2:39 pm
by fman
OK for the workaround, I have asked to open ticket in order to analise and fix if needed

thanks