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

No database privilege created when database is created. #9225

Closed
dwene opened this issue Feb 28, 2020 · 5 comments
Closed

No database privilege created when database is created. #9225

dwene opened this issue Feb 28, 2020 · 5 comments
Labels
inactive Inactive for >= 30 days

Comments

@dwene
Copy link

dwene commented Feb 28, 2020

When a new database is created, there isn't a corresponding database privilege created.

I've been trying to follow the docs for adding Gamma users here: https://superset.incubator.apache.org/security.html#sql-lab

I'd like to create a Gamma user, give them sql lab rights, and give them access to a single database.
When I add a database in the UI, and try to create a new role with privileges to query that database, there doesn't appear to be one.

There is however a database privilege for the initially examples database. So it seems to me like there should be a database privilege for the other databases I added also, so that I can grant Gamma+sql_lite role users access to use sql lab.

Expected results

A new database privilege is created when I add a database

Actual results

No database privilege is created.

Screenshots

Screen Shot 2020-02-28 at 5 32 00 PM

Screen Shot 2020-02-28 at 5 32 11 PM

Notice how there is no database privilege for "dwene" but there is one for "example"

How to reproduce the bug

  1. Go to Sources -> Databases.
  2. Add a new database.
  3. Go to roles.
  4. Try to create a new role with the new database privilege.
  5. Notice that there is no database privilege, only datasource and schema privileges.

Environment

(please complete the following information):

  • superset version: 0.35.2
  • python version: whatever is in the built docker container.

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • [ x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x ] I have reproduced the issue with at least the latest released version of superset.
  • [x ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

@nytai
Copy link
Member

nytai commented Feb 28, 2020

hey @dwene check out: #8699

It may satisfy your requirements

@dwene dwene changed the title No database role created when database is created. No database privilege created when database is created. Feb 29, 2020
@dwene
Copy link
Author

dwene commented Feb 29, 2020

Hey @nytai , thanks for responding.

The row based security is pretty cool! But not really what I'm looking for. I'm looking for a way to grant a user access to SQL lab for only 1 database. It seems like the way to do that is by making a new role with that database privilege (datasource and schema privileges don't appear to be enough), but I can't seem to find a way to add it.

@dwene
Copy link
Author

dwene commented Feb 29, 2020

Additional screenshot showing missing database_access privilege.
I've added 2 other databases.

image

@dwene
Copy link
Author

dwene commented Feb 29, 2020

Interestingly enough, editing the database and saving (without making any changes) seems to resolve the problem.

@stale
Copy link

stale bot commented Apr 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 29, 2020
@stale stale bot closed this as completed May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

2 participants