mongodb / mongo-jdbc-driver

JDBC Driver for MongoDB Atlas SQL interface
Apache License 2.0
35 stars 33 forks source link

jdbc getColumns only works for admin #137

Closed ryanhamilton closed 9 months ago

ryanhamilton commented 11 months ago

Hi,

I was attempting to call various forms of getColumns but was getting a permissions error. It seems a user needs to be admin to get the list of tables, this seems unusual. I think usually at least the tables a user is permissioned to see are shown.

r = getColumns(serverConfig, null, null, "%", "%");
r = getColumns(serverConfig, null, null, null, null);

This is using Atlas today (2023-08-01) with JDBC driver mongodb-jdbc-2.0.2-all.jar.

Once I assign myself admin permissions, the tables are returned.

jchemburkar commented 9 months ago

@ryanhamilton you have the correct understanding, but to clarify, the user needs the following for the tables to be returned:

Custom Roles:

Privileges: