Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003684TestLinkAPI - XMLRPCpublic2010-08-17 16:212010-10-09 08:02
Reporteryaliu_2000 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Fixed in Version1.9 Beta 5 
Summary0003684: User with testplan_execute role could not update result due to userHasRight function in xmlrpc.php did not pass testplan_id
DescriptionUser with testplan_execute right could not update result because in function userHasRight in xmlrpc.php, testplan_id passed in user->hasRight is empty. I add the following two lines before calling user->hasRight.

      $testplan_id = $this->dbObj->prepare_int($this->args[self::$testPlanIDParamName]);
      $testprojectid = $this->dbObj->prepare_int($this->args[self::$testProjectIDParamName]);

Please take the change.

TagsNo tags attached.
Database (MySQL,Postgres,etc)mysql
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0010892)
fman (administrator)
2010-08-19 17:22

please provide TL version
(0010893)
yaliu_2000 (reporter)
2010-08-19 17:34

The TL version is 1.8.4
(0010894)
fman (administrator)
2010-08-19 17:53

we are not developing patches for 1.8.x, but will check 1.9 BETA
(0010907)
fman (administrator)
2010-08-21 08:02

Please give better information:
1. on what method do you have added the lines
2. detailed steps to reproduce
(0011239)
yaliu_2000 (reporter)
2010-09-02 21:30

Those changes should be in xmlrpc.php and in function 'userHasRight'. the changes are:
      $status_ok=true;
      //yliu: passing testplan id to hasRight function so users with right testplan role can execute test
      $testplan_id = $this->dbObj->prepare_int($this->args[self::$testPlanIDParamName]);
      $testprojectid = $this->dbObj->prepare_int($this->args[self::$testProjectIDParamName]);
        if( !$this->user->hasRight($this->dbObj,$roleQuestion,$testprojectid, $testplan_id))

This is the way I reproduce and test it:
# first add staf service - tlwriter to PC 10.218.103.195
staf local service add SERVICE TLWriter LIBRARY JSTAF EXECUTE C:\Tes
tAutomation\Testlink.jar PARMS "SERVER=http://158.218.108.109/testlink/lib/api/xmlrpc.php [^] DEVKEY=2721b84044654e0b9a8cac8235829855"

# then, using tlwriter service to update result
staf 10.218.103.195 tlwriter update planid 278281 buildid 1681 testcase 2021 status f notes "Test Failed"

Thanks,
Yan
(0011248)
fman (administrator)
2010-09-03 16:32

Current code already uses testplan_id => will set to resolved
(0011839)
fman (administrator)
2010-10-09 08:02

Release 1.9 RC1

- Issue History
Date Modified Username Field Change
2010-08-17 16:21 yaliu_2000 New Issue
2010-08-19 17:22 fman Note Added: 0010892
2010-08-19 17:22 fman Assigned To => fman
2010-08-19 17:22 fman Status new => feedback
2010-08-19 17:34 yaliu_2000 Note Added: 0010893
2010-08-19 17:34 yaliu_2000 Status feedback => assigned
2010-08-19 17:53 fman Note Added: 0010894
2010-08-21 08:02 fman Note Added: 0010907
2010-09-02 21:30 yaliu_2000 Note Added: 0011239
2010-09-03 16:32 fman Note Added: 0011248
2010-09-03 16:33 fman Status assigned => resolved
2010-09-03 16:33 fman Fixed in Version => 1.9 Beta 5
2010-09-03 16:33 fman Resolution open => fixed
2010-10-09 08:02 fman Note Added: 0011839
2010-10-09 08:02 fman Status resolved => closed
2013-04-25 17:30 fman Category TL API => XMLRPC API
2013-04-25 17:30 fman Category XMLRPC API => API - XMLRPC



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker