gltn / stdm

STDM is a free and open source pro-poor land recordation system based on QGIS, PostgreSQL and PostGIS.
http://stdm.gltn.net/
GNU General Public License v2.0
31 stars 29 forks source link

Couldn't save to a table with permission #220

Closed wondie closed 3 years ago

wondie commented 7 years ago

We tried to save into a table with permission but it is showing the following error message.

An error has occurred while executing Python code: 

ProgrammingError: (ProgrammingError) permission denied for sequence ko_household_id_seq 'INSERT INTO ko_household (household_number, number_of_male, number_of_female, household_vicinity, house_use_type, house_type, written_tenure_agreement, form_of_agreement, house_eastings, house_northings, tenure_type) VALUES (%(household_number)s, %(number_of_male)s, %(number_of_female)s, %(household_vicinity)s, %(house_use_type)s, %(house_type)s, %(written_tenure_agreement)s, %(form_of_agreement)s, %(house_eastings)s, %(house_northings)s, %(tenure_type)s) RETURNING ko_household.id' {'house_use_type': 1, 'household_number': u'U1/002', 'written_tenure_agreement': None, 'house_eastings': u'', 'tenure_type': None, 'house_northings': u'', 'house_type': None, 'number_of_female': 0, 'household_vicinity': 1, 'form_of_agreement': u'', 'number_of_male': 0} 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\stdm\data\mapping.py", line 390, in submit
    self._persistModel(save_and_new)
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\stdm\data\mapping.py", line 402, in _persistModel
    self._model.save()
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\stdm\data\database.py", line 239, in save
    raise db_error
ProgrammingError: (ProgrammingError) permission denied for sequence ko_household_id_seq
 'INSERT INTO ko_household (household_number, number_of_male, number_of_female, household_vicinity, house_use_type, house_type, written_tenure_agreement, form_of_agreement, house_eastings, house_northings, tenure_type) VALUES (%(household_number)s, %(number_of_male)s, %(number_of_female)s, %(household_vicinity)s, %(house_use_type)s, %(house_type)s, %(written_tenure_agreement)s, %(form_of_agreement)s, %(house_eastings)s, %(house_northings)s, %(tenure_type)s) RETURNING ko_household.id' {'house_use_type': 1, 'household_number': u'U1/002', 'written_tenure_agreement': None, 'house_eastings': u'', 'tenure_type': None, 'house_northings': u'', 'house_type': None, 'number_of_female': 0, 'household_vicinity': 1, 'form_of_agreement': u'', 'number_of_male': 0}

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] 
QGIS version: 2.18.3 Las Palmas, 77b8c3d 

Python Path:
C:/Users/Wondim/.qgis2/python/plugins\processing
C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python
C:/Users/Wondim/.qgis2/python
C:/Users/Wondim/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\bin\python27.zip
C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.18\bin
C:\PROGRA~1\QGIS2~1.18\apps\Python27
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\PIL
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/Wondim/.qgis2//python
C:\Users\Wondim\.qgis2\python\plugins
C:\PROGRA~1\QGIS2~1.18\apps\qgis\python\plugins\stdm\third_party
C:\PROGRA~1\QGIS2~1.18\apps\qgis\python\plugins\stdm\third_party\fontTools
C:\Users\Wondim\.qgis2\python\plugins\mmqgis/forms
gkahiu commented 7 years ago

This is a limitation of the current security framework. It'll be redesigned in the v2.0 based on the proposal submitted some time back.

On Wed, 1 Mar 2017 at 16:12 Wondimagegn Tesfaye notifications@github.com wrote:

Assigned #220 https://github.com/gltn/stdm/issues/220 to @gkahiu https://github.com/gkahiu.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/gltn/stdm/issues/220#event-981808475, or mute the thread https://github.com/notifications/unsubscribe-auth/ADqZC-2BdVy62qjRnUmHCrWkQdtdDEFqks5rhW6egaJpZM4MPoss .

wondie commented 7 years ago

This issue is now partly fixed by this commit. However, we need to find a way to integrate it to the schema update so that permissions are given when we create entities and sequences after the creation of user groups.