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

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
usunkad
TestLink user
Posts: 8
Joined: Fri May 29, 2009 8:51 pm

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

Post 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.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

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

Post 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.
RvdP2012
TestLink user
Posts: 10
Joined: Thu May 31, 2012 6:55 pm
Location: Veldhoven, Netherlands
Contact:

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

Post 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.
Richard van der Pols
Philips Lighting,
Eindhoven, The Netherlands.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

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

Post 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
RvdP2012
TestLink user
Posts: 10
Joined: Thu May 31, 2012 6:55 pm
Location: Veldhoven, Netherlands
Contact:

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

Post by RvdP2012 »

OK, I'll do so. Just tried to provide a possible workaround (which works for us).
Richard van der Pols
Philips Lighting,
Eindhoven, The Netherlands.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

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

Post by fman »

OK for the workaround, I have asked to open ticket in order to analise and fix if needed

thanks
Post Reply