opengisch / QgisModelBaker

Create QGIS projects from database schemas or Interlis models
https://opengisch.github.io/QgisModelBaker/
GNU Lesser General Public License v3.0
55 stars 17 forks source link

Export Data: Superuser Login required when using an Authentication Configuration #905

Closed webrian closed 1 month ago

webrian commented 6 months ago

Is there a specific reason why a superuser login is required when using an authentication configuration?

When using a user name and password in Basic Authentication, however, no superuser login is required.

Bildschirmfoto vom 2024-05-01 10-11-52

signedav commented 6 months ago

In case you have a normal login (without superuser) defined in a generally named authentication (maybe something others have as well) and then you create the schema and you need superuser login for that, then you could edit your own authentication file, yes, but it would be easier to keep it untouched and just create it with the superuser settings from the Model Baker settings. Or do I understand it wrong?

webrian commented 6 months ago

No, this is about the data export workflow.

Suppose I connect to the database with a user with read permission (SELECT privileges) only.

Case A: I connect to the database using an authentication configuration (in Configuration tab):

Bildschirmfoto vom 2024-05-01 10-11-52

The wizard forces me to check Execute data management tasks with superuser login from settings (postgres), but 1. as a "normal" user I do not have superuser access to our production database 2. (and more important) it should not be necessary for an export, as no table or schema is changed. Thus no export can be done.

Whereas case B: I connect to the database using Basic auth with username and password (in Basic tab):

There is no need to check Execute ... with superuser login ... and it works anyway as expected:

Bildschirmfoto vom 2024-05-06 11-21-33

Bildschirmfoto vom 2024-05-06 11-21-56

I don't see any reason why a superuser login is required when using the authentication configuration, but not when entering username and password. On our production database only a few users have more than read privileges on certain selected schemas.

signedav commented 6 months ago

Ah now I get it. I haven't seen the message below and assumed you want to ask, why there is the option to use superuser...

Well:

  1. yes, on export this option could be hidden, but this is not your issue here anyway.

  2. Why it requires superuser login on authentication configuration I don't know. I'll have to check that...

signedav commented 6 months ago

(not sure if it's a bug, but I added it to have it on the list)

gacarrillor commented 1 month ago

I don't see any reason why a superuser login is required when using the authentication configuration, but not when entering username and password.

@signedav, for reference, there would be a remaining question/comment by @webrian, although it's not a blocker for closing this issue:

For doing administrative tasks, should the Use superuser checkbox also be required to be checked when using the Basic authentication tab ?