View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
07881Bug reportsRemoteControlpublic2013-10-23 14:40
Reporterallinonesoftware Assigned Totrougakoss  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.05 RC 
Summary07881: Only survey owner has access to the survey
Description

In the LimeSurvey backend it is possible to grant another user access to a survey.
But these privileges are not checked in the list_survey function.

Therefore when logging into the remote control with user B who was granted access (but isn't owner) to survey A, will only return survey B

Steps To Reproduce
  • Create survey A with user A
  • Create survey B with user B
  • Grant user B access to survey A
  • Call list_survey function
TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)130514
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1.41
Server OS (if known)Ubuntu 10.04
Webserver software & version (if known)Apache 2.2.14
PHP Version5.3.2

Users monitoring this issue

c_schmitz

Activities

Mazi

Mazi

2013-06-27 09:14

updater   ~25675

Hi muhzak,

do you need any further help with solving this? When can we expect a fix?

Mazi

Mazi

2013-09-18 11:23

updater   ~26268

trougakoss, I am assigning this one to you since it is related to the API working differently than the Limesurvey admin backend.

Let me know if you have any further questions or need any more details.

trougakoss

trougakoss

2013-09-18 18:48

reporter   ~26283

I ll give you a response as soon as possible.

trougakoss

trougakoss

2013-09-26 16:53

reporter   ~26388

The remotecontrol in list_surveys, lists only the surveys that belong to the user.

That means that there is no check being made for surveys that the user in question has some privileges on.

This of course is different from the behaviour of the Limesurvey admin backend and if we think that the behaviour should be exactly the same, i will make the appropriate changes.
What do you think Mazi???

Mazi

Mazi

2013-09-26 17:11

updater   ~26389

I assume "The remotecontrol in list_surveys, lists only the surveys that belong to the user" means that the user's UID is listed at the table listing the survey rights and IDs?

Since a user might be assigned to a survey but not have assigned any rights, we should better query for certain survey rights as well, depending on the action.

c_schmitz, what do you think?

DenisChenu

DenisChenu

2013-09-26 17:50

developer   ~26390

Hi,

Think behaviours must be exacltly the same.

list_surcey : show survey.
I a user ask for "responses" look user response view right.

no ?

c_schmitz

c_schmitz

2013-09-26 21:30

administrator   ~26391

I agree to Mazi. If needed you will have to refactor the function behind the GUI survey list so it can be used by RemoteControl, too.

trougakoss

trougakoss

2013-09-29 16:49

reporter   ~26435

So in other words the list_survey function will be defined like this
public function list_surveys($sSessionKey, $sUser=NULL, $aPrivileges=NULL)

By default the privileges are set to null so only the ownership will be checked (current behaviour).
In case the user defines an privilege, or an array of privileges, then the privileges table will be checked and the additional surveys will be shown.

So in other words the current behaviour wont be changed, but we will accommodate for the extra needs.
If there is anything i have forgotten please feel free to remind me.

c_schmitz

c_schmitz

2013-09-29 17:04

administrator   ~26436

Last edited: 2013-09-29 17:04

Almost. ;)
I think that the survey list shown to the user in the GUI and the one given back in RemoteControl API should be the same. Since they are not the same currently they most likely use a different code. They should use the same code you will need to make the RC code use the GUI code instead - if necessary you might have to refactor code parts so they can be used by both, GUI and RC.

trougakoss

trougakoss

2013-09-29 17:54

reporter   ~26437

So.... i did not understand correctly... :P
Let me rephrase that......
The list_surveys function definition will remain the same, but now the function will behave exactly like the gui.
Upon request the permissions will be checked and ALL the surveys that the user has some permission or owns will be shown.
Furthermore i will try to use the helper functions that the gui uses (if applicable).
Am i correct now?

c_schmitz

c_schmitz

2013-09-29 17:56

administrator   ~26438

Yes, you are correct. Thank you for your diligence, Spiros!

trougakoss

trougakoss

2013-10-01 12:40

reporter   ~26455

Pull request #135
If everything is ok, i will merge by tomorrow.

c_schmitz

c_schmitz

2013-10-07 21:46

administrator   ~26606

Last edited: 2013-10-07 21:46

I assume you were not able to use the GUI function? Anyway, looks good - please merge.

c_schmitz

c_schmitz

2013-10-09 09:46

administrator   ~26641

trougakoss, you will need to patch the 2.05 branch too. Can you do this please and then set this issue to resolved? Thank you!

trougakoss

trougakoss

2013-10-09 17:22

reporter   ~26673

Carsten as you might saw i did not use the gui function because it did not provide me with the extra functionality that the RC has.
Anyways i patched the 2.05 branch too, and by the end of the day i will merge.
Thanks!

c_schmitz

c_schmitz

2013-10-23 14:40

administrator   ~26957

2.05RC3 released.

Related Changesets

LimeSurvey: master 3c147910

2013-10-07 19:48:40

trougakoss

Details Diff
Merge pull request #135 from trougakoss/master

Fixed issue:07881: Only survey owner has access to the survey
Affected Issues
07881
mod - application/controllers/admin/remotecontrol.php Diff File

Issue History

Date Modified Username Field Change
2013-05-27 06:10 allinonesoftware New Issue
2013-05-27 14:33 c_schmitz Assigned To => muhzak
2013-05-27 14:33 c_schmitz Status new => assigned
2013-06-27 09:14 Mazi Note Added: 25675
2013-06-27 09:15 Mazi Issue Monitored: trougakoss
2013-09-18 11:22 Mazi Assigned To muhzak => trougakoss
2013-09-18 11:23 Mazi Note Added: 26268
2013-09-18 18:48 trougakoss Note Added: 26283
2013-09-26 16:53 trougakoss Note Added: 26388
2013-09-26 17:11 Mazi Note Added: 26389
2013-09-26 17:11 Mazi Issue Monitored: c_schmitz
2013-09-26 17:50 DenisChenu Note Added: 26390
2013-09-26 21:30 c_schmitz Note Added: 26391
2013-09-27 21:40 c_schmitz Issue End Monitor: trougakoss
2013-09-29 16:49 trougakoss Note Added: 26435
2013-09-29 17:04 c_schmitz Note Added: 26436
2013-09-29 17:04 c_schmitz Note Edited: 26436
2013-09-29 17:54 trougakoss Note Added: 26437
2013-09-29 17:56 c_schmitz Note Added: 26438
2013-10-01 12:40 trougakoss Note Added: 26455
2013-10-07 21:46 c_schmitz Note Added: 26606
2013-10-07 21:46 c_schmitz Note Edited: 26606
2013-10-07 21:46 c_schmitz Note Edited: 26606
2013-10-09 09:45 c_schmitz Changeset attached => LimeSurvey master 3c147910
2013-10-09 09:46 c_schmitz Note Added: 26641
2013-10-09 09:46 c_schmitz Status assigned => feedback
2013-10-09 17:22 trougakoss Note Added: 26673
2013-10-11 12:42 trougakoss Status feedback => resolved
2013-10-11 12:42 trougakoss Fixed in Version => 2.05 RC
2013-10-11 12:42 trougakoss Resolution open => fixed
2013-10-23 14:40 c_schmitz Note Added: 26957
2013-10-23 14:40 c_schmitz Status resolved => closed
2021-08-02 16:09 guest Bug heat 8 => 10