linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Write tests for test plan number 4 (admin panel) #153

Closed strk closed 3 years ago

strk commented 3 years ago

Use the Admin Panel to

a): create new users and add permissions, b): edit system codes to affect the application create and remove things c): publish the Gazetteer

strk commented 3 years ago

When testing the admin panel manually (make docker-qgis-start) I get a Gazetteer authorization error:

You are not authorised to run gazetteer administration functions

The error, according to code, is triggered when the user is not DBA:

elf._controller.database().userIsDba()

In turn that function invokes SQL function:

return scalar("select gazetteer.gaz_IsGazetteerDba()")

According to the About panel:

Database user: gazadmin

The SQL function does:

SELECT EXISTS (SELECT * FROM gazetteer_users WHERE userid=current_user AND isdba);

We're indeed NOT populating the gazetteer_users table, neither directly nor via the gazetteer.gaz_AddUser function. I guess we should. Also, if we do, we'd need to switch to the gazdba user, which we create, to have those permissions (right now the plugin configuration uses gazadmin instead)

strk commented 3 years ago

PR #155 helps with the above