Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008058TestLinkAPI - XMLRPCpublic2017-08-22 09:292017-08-28 13:37
Reporterrichard.kovari 
Assigned Tofman 
PrioritynormalSeverityblockReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.9.15 (2015 Q4) 
Fixed in Version1.9.16 (2016 Q4) 
Summary0008058: Can not create platform by the Python API, but it works by hand.
DescriptionI'm trying to report test result by a python script. Everything works fine until it gets to the platform creation.

I have platform management right and I can create platforms by hand, but I can't create paltforms by using the API's createPlatform() function.

TestLink-API-Python-client==0.6.4
Steps To ReproducetestHelper = testlink.TestLinkHelper()
testHelper._devkey = DEV_KEY
testHelper._server_url = XMLRPC_SERVER
connection = testHelper.connect(testlink.TestlinkAPIClient)
NEW_PLATFORM = connection.createPlatform(PROJECT_NAME, PLATFORM_NAME)
TagsNo tags attached.
Database (MySQL,Postgres,etc)no information
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Filespng file icon testlink_problem.png [^] (231,618 bytes) 2017-08-23 10:27


png file icon testlink_rights.png [^] (22,030 bytes) 2017-08-23 10:37


jpg file icon pseudo_admin.jpg [^] (128,769 bytes) 2017-08-24 13:14

- Relationships

-  Notes
(0026756)
fman (administrator)
2017-08-22 16:37

we do not offer support for python implementations
(0026757)
richard.kovari (reporter)
2017-08-23 08:01
edited on: 2017-08-23 09:01

Does this function works on other platforms, with the XMLRPC-API? It worked fine on the TestLink 1.9.6 and 1.9.14 that I have tested. It may be an issue with the newer versions of TestLink. I've used the same API version during testing.

(0026758)
fman (administrator)
2017-08-23 09:42

Please use PHP sample client provided with TestLink installation to test it.
Then if issue persists I will be able to do similar test
(0026759)
richard.kovari (reporter)
2017-08-23 10:26
edited on: 2017-08-23 10:38

I tried to send an XML to the XMLRPC-API on the TestLink server, using Postman, and I got the same result: "User corresponding to Developer Key has insufficient rights to perform this action- Details: right platform_management, test project id: 0, test plan id: "

I'm giving the API my devKey, platformname and testprojectname.

This method still works with the TestLink version 1.9.6

I added screenshots of the problem. I have platform management right, but the API responds that I have insufficient rights(platform_management)...

(0026760)
fman (administrator)
2017-08-23 12:05
edited on: 2017-08-23 12:06

1.9.6 is far distant from 1.9.16 then IMHO that thinks does not work is normal.
I'm going to check

(0026763)
richard.kovari (reporter)
2017-08-23 12:25

I've just checked it with 1.9.14 and it works there also.

I send exactly the same request(except the devKey) to 1.9.14 as to 1.9.15, but 1.9.15 is not working.

Maybe there was a change in authorization from 1.9.14 to 1.9.15 that messed this up.
(0026764)
fman (administrator)
2017-08-23 12:47

ok, thanks for your tests
(0026765)
richard.kovari (reporter)
2017-08-23 12:55

Your welcome. I hope You can find the problem.
(0026766)
hughkay (reporter)
2017-08-23 13:10

@richard.kovari:
From your screenshot I assume you've created a new role named "pseudo-admin" which should have the same rights as the standard admin role, right?
Unfortunately, when creating a new role in Testlink, it is not possible via the GUI to cover ALL rights of the tool.
Even if you've selected all visible options, there are still some rights left, which are not visible in the GUI.
There have been some updates to rights-management in the past few Testlink versions.

Hence please login to your SQL database in the background and activate all "role_rights" for your new role manually. This way you can be sure that you have the necessary permissions.
Maybe that helps.
(0026767)
richard.kovari (reporter)
2017-08-23 13:31

I'm not the administrator of the TestLink but I'll forward this to the admin.

Is it possible, that in the GUI, the "platform_management" role is ticked, but I don't have the role?
(0026769)
richard.kovari (reporter)
2017-08-24 13:11

I contacted the admin of our TestLink.

We tried that the "pseudo-admin" had every rights that the "admin" has, but the platform creation did not work.

We tried that I got the "admin" role, and it worked, and only with "admin" role.

Our admin mentioned that there were some other problems with the right management like after creating a role = admin (a copy of the admin role) and it was not able to see the test case execution.
(0026770)
hughkay (reporter)
2017-08-24 13:34

@richard.kovari:
That's what I suspected. The admin has some "hidden" rights, that cannot be copied when creating a new role via the GUI.
Did your admin make sure he added ALL rights via SQL query in the SQL database for your "pseudo-admin" role? And not just selecting all checkboxes via the GUI?
(0026771)
richard.kovari (reporter)
2017-08-24 14:46

Yes, he made sure, that the 'pseudo-admin' has exactly the same rights as 'admin' has, and I got the same error, that I do not have the right.
We even tried the default role 'leader' which has "platform_management" right by default, but it did not work too.
Btw I have platform_management in the GUI and in the SQL database too, so it should work, but it doesn't.

Platform creation works fine by hand, but sends back the error "User corresponding to Developer Key has insufficient rights to perform this action- Details: right platform_management, test project id: 0, test plan id: " when I try to do it by the API.

What is the difference between the two methods (by hand, by the API)?
(0026772)
fman (administrator)
2017-08-24 18:42

>> What is the difference between the two methods (by hand, by the API)?
Well if you give a look to createPlatform method on xmlrpc.class.php, you will see:

public function createPlatform($args)
  {
    $this->_setArgs($args);
    $status_ok = false;
    $msg_prefix="(" . __FUNCTION__ . ") - ";

    if($this->authenticate() &&
       $this->userHasRight("platform_management",self::CHECK_PUBLIC_PRIVATE_ATTR))
    {

Then user needs platform_management right
(0026773)
fman (administrator)
2017-08-24 18:43

On platformsEdit.php

function checkPageAccess(&$db,&$argsObj)
{
  $env['script'] = basename(__FILE__);
  $env['tproject_id'] = isset($argsObj->testproject_id) ? $argsObj->testproject_id : 0;
  $env['tplan_id'] = isset($argsObj->tplan_id) ? $argsObj->tplan_id : 0;
$argsObj->currentUser->checkGUISecurityClearance($db,$env,array('platform_management'),'and');
}
(0026774)
fman (administrator)
2017-08-24 19:20

Tested on MAC OS using mamp Pro, using latest code from github

1. created user XMLRPC-API-INTEGRATION, with role GUEST
2. create a new role xmlrpc-api-integration with JUST one right platform-management
3. login as XMLRPC-API-INTEGRATION, generate API Key
4. use clientCreatePlatform.php
5. Platform created without issues


I'm going to try woth fresh 1.9.16, anyway please check http://mantis.testlink.org/view.php?id=7817 [^]
(0026778)
richard.kovari (reporter)
2017-08-25 08:20

Please test 1.9.15 too.

Thank You for the investigation.
(0026779)
fman (administrator)
2017-08-25 09:58

>> Please test 1.9.15 too.
I'm sorry but I never test any version older than Lastest Released.
(0026781)
fman (administrator)
2017-08-26 09:44

Tested on 1.9.16 => no issue
(0026793)
richard.kovari (reporter)
2017-08-28 13:37

The problem is now solved. The problem was that the user role was not set up well. Thank You for your help.

- Issue History
Date Modified Username Field Change
2017-08-22 09:29 richard.kovari New Issue
2017-08-22 16:37 fman Note Added: 0026756
2017-08-23 08:01 richard.kovari Note Added: 0026757
2017-08-23 09:01 richard.kovari Note Edited: 0026757 View Revisions
2017-08-23 09:42 fman Note Added: 0026758
2017-08-23 09:42 fman Assigned To => fman
2017-08-23 09:42 fman Status new => feedback
2017-08-23 10:26 richard.kovari Note Added: 0026759
2017-08-23 10:26 richard.kovari Status feedback => assigned
2017-08-23 10:27 richard.kovari File Added: testlink_problem.png
2017-08-23 10:37 richard.kovari File Added: testlink_rights.png
2017-08-23 10:38 richard.kovari Note Edited: 0026759 View Revisions
2017-08-23 12:05 fman Note Added: 0026760
2017-08-23 12:06 fman Note Edited: 0026760 View Revisions
2017-08-23 12:25 richard.kovari Note Added: 0026763
2017-08-23 12:47 fman Note Added: 0026764
2017-08-23 12:55 richard.kovari Note Added: 0026765
2017-08-23 13:10 hughkay Note Added: 0026766
2017-08-23 13:31 richard.kovari Note Added: 0026767
2017-08-24 13:11 richard.kovari Note Added: 0026769
2017-08-24 13:14 richard.kovari File Added: pseudo_admin.jpg
2017-08-24 13:34 hughkay Note Added: 0026770
2017-08-24 14:46 richard.kovari Note Added: 0026771
2017-08-24 18:42 fman Note Added: 0026772
2017-08-24 18:43 fman Note Added: 0026773
2017-08-24 19:20 fman Note Added: 0026774
2017-08-24 19:21 fman Status assigned => feedback
2017-08-25 08:20 richard.kovari Note Added: 0026778
2017-08-25 08:20 richard.kovari Status feedback => assigned
2017-08-25 09:58 fman Note Added: 0026779
2017-08-25 09:59 fman QA Team - Task Workflow Status => TBD
2017-08-25 09:59 fman Priority immediate => normal
2017-08-26 09:44 fman Fixed in Version => 1.9.16 (2016 Q4)
2017-08-26 09:44 fman Note Added: 0026781
2017-08-26 09:45 fman Status assigned => resolved
2017-08-26 09:45 fman Resolution open => fixed
2017-08-28 13:37 richard.kovari Note Added: 0026793



Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker