Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: LimeSurveyStatusError: Invalid setting raised for users without Superadmin permission #142

Closed
edgarrmondragon opened this issue Jan 28, 2022 · 0 comments · Fixed by #143
Assignees
Labels
bug Something isn't working

Comments

@edgarrmondragon
Copy link
Owner

Citric Version

0.0.6

Python Version

3.9

LimeSurvey Version

4.6.3

Operating System

MacOS

Description

Users without Superadministrator permission can not use the library because the Session constructor tries to get the RPCInterface setting, but it's restricted for them.

Code

>>> import citric
>>> LS_URL = 'http://localhost:8001/index.php/admin/remotecontrol'
>>> with citric.Client(LS_URL, 'restricted-user', 'verysecret') as client:
...     with open("./my_survey.lss", "rb") as f:
...         client.import_survey(f, survey_name="example")
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/edgarramirez/Code/citric/src/citric/client.py", line 64, in __init__
    self.__session = self.session_class(
  File "/Users/edgarramirez/Code/citric/src/citric/session.py", line 68, in __init__
    if self.get_site_settings("RPCInterface") != "json":
  File "/Users/edgarramirez/Code/citric/src/citric/method.py", line 27, in __call__
    return self.__caller(self.__name, *params)
  File "/Users/edgarramirez/Code/citric/src/citric/session.py", line 103, in rpc
    result = self._invoke(self._session, self.url, method, self.key, *params)
  File "/Users/edgarramirez/Code/citric/src/citric/session.py", line 149, in _invoke
    raise LimeSurveyStatusError(result["status"])
citric.exceptions.LimeSurveyStatusError: Invalid setting

Permissions Matrix

The following set of permissions on a user triggers the error:

Screen Shot 2022-01-27 at 23 18 18

@edgarrmondragon edgarrmondragon added the bug Something isn't working label Jan 28, 2022
@edgarrmondragon edgarrmondragon self-assigned this Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant