View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
17739 | Bug reports | User / Groups / Roles | public | 2021-11-18 23:30 | 2022-05-02 10:33 |
Reporter | Mapache | Assigned To | gabrieljenik | ||
Priority | none | Severity | block | ||
Status | closed | Resolution | fixed | ||
Product Version | 5.2.x | ||||
Summary | 17739: list_surveys JSON-RPC API method does not obey $sUsername if set | ||||
Description | using a dedicated API-user-account like "api" does not return only those surveys that belong to a given user but all surveys. | ||||
Steps To Reproduce | Steps to reproduce1) add a user account like "api" Expected result{"method": "list_surveys", "params": ["TOKEN", null], "id": 1} => return all surveys for every user Actual result{"method": "list_surveys", "params": ["TOKEN", null], "id": 1} => returns all surveys for every user | ||||
Tags | api | ||||
Bug heat | 14 | ||||
Complete LimeSurvey version number (& build) | 5.2.2+211115 (starting from 4.3.34) | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | MySQL 8.0 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 7.4.25 | ||||
Hi,
|
|
cannot follow you here... I tried with global and without global permissions but anyhow: If a username is passed, i.e. not null, it should return users for that user only. As for "Are you using the remote control mehotd as expected?" API doc says: List the survey belonging to a user (RPC function) "sSessionKey" === TOKEN in my example.. |
|
If you apply read permissions on the global level, the user will be able to read all surveys.
|
|
"If a username is passed, i.e. not null, it should return users for that user only." correct: "If a username is passed, i.e. not null, it should return SURVEYS for that user only." |
|
Get session key: { "method": "get_session_key", "params": ["someapiuser", "supersecret"], "id": 1 } {"method": "list_surveys", "params": ["abf5BiVjqajsHJ4NhL0iF0hWNHsecI11", "someuser"], "id": 1} As mentioned before: Doc says: list_surveys(string $sSessionKey,string|null $sUsername = null): array As for your permission "hint": IF $sUsername != null in list_surveys(string $sSessionKey,string|null $sUsername = null): array IT MUST return only the surveys for the user otherwise that option would be useless. |
|
If you apply read permissions on the global level, the user will be able to read all surveys. => This doesn't make sense. If I give a user permissions on a specific survey I would not need to pass the username param to list_surveys as it would / should then only return the users surveys anyways.. |
|
I am sorry, I confused the coma and read it like a full-colon.
Well, not always. I think you are assuming you are connecting with user A and want to get surveys for user A. OK, let us review it and play around with it. As to clarify:
|
|
As far as I remember it used to work (as expected) on 3.x LTS |
|
Yep. Me too. And from what I see, there hasn't been much changes around that. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33455 |
|
Fixed in Release 5.3.12+220502 |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2021-11-18 23:30 | Mapache | New Issue | |
2021-11-18 23:32 | Mapache | Tag Attached: api | |
2021-11-19 09:19 | galads | Assigned To | => galads |
2021-11-19 09:19 | galads | Status | new => acknowledged |
2021-11-30 10:19 | DarioRoig | Bug heat | 0 => 6 |
2021-11-30 10:20 | DarioRoig | Issue Monitored: DarioRoig | |
2021-11-30 10:20 | DarioRoig | Bug heat | 6 => 8 |
2022-04-12 10:11 | galads | Assigned To | galads => gabrieljenik |
2022-04-12 15:18 | gabrieljenik | Note Added: 69007 | |
2022-04-12 15:18 | gabrieljenik | Bug heat | 8 => 10 |
2022-04-12 15:18 | gabrieljenik | Status | acknowledged => feedback |
2022-04-12 15:22 | Mapache | Note Added: 69008 | |
2022-04-12 15:22 | Mapache | Bug heat | 10 => 12 |
2022-04-12 15:22 | Mapache | Status | feedback => assigned |
2022-04-12 15:28 | gabrieljenik | Note Added: 69009 | |
2022-04-12 15:31 | Mapache | Note Added: 69010 | |
2022-04-12 15:44 | Mapache | Note Added: 69011 | |
2022-04-12 15:47 | Mapache | Note Added: 69012 | |
2022-04-12 15:56 | gabrieljenik | Note Added: 69013 | |
2022-04-12 15:59 | Mapache | Note Added: 69014 | |
2022-04-12 16:02 | gabrieljenik | Note Added: 69015 | |
2022-04-13 14:00 | gabrieljenik | Note Added: 69050 | |
2022-04-13 14:00 | gabrieljenik | Status | assigned => ready for testing |
2022-05-02 07:58 | gabrieljenik | Changeset attached | => LimeSurvey master 64a45a78 |
2022-05-02 07:58 | gabrieljenik | Note Added: 69326 | |
2022-05-02 07:58 | gabrieljenik | Resolution | open => fixed |
2022-05-02 10:33 | LimeBot | Note Added: 69340 | |
2022-05-02 10:33 | LimeBot | Status | ready for testing => closed |
2022-05-02 10:33 | LimeBot | Bug heat | 12 => 14 |