database_access on [mydb] permissionview not created when database added
See original GitHub issueMake sure these boxes are checked before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if any
- I have reproduced the issue with at least the latest released version of superset
- I have checked the issue tracker for the same issue and I haven’t found one similar
Superset version
0.22.1
Expected results
When a new database is added, immediately afterwards the permissionview database_access on [mydb] should be created.
Actual results
Permissionview is not created (only schema permissionviews and datasource permissionviews are created). If an update is run on the db, then the database_access permissionview is created.
Steps to reproduce
Add a new database and without any further actions try creating a role that has database_access on this database. This is not possible as permissionview does not exist. If an update is run on the database (without changing anything) then permissionview is correctly created.
Looking at the code it appears that in this line it should use db.get_perm() instead db.perm as db.perm is not set before the database is inserted (it is only set after insert).
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
The following resolves this issue:
https://github.com/andrewsali/incubator-superset/commit/00e9820934e47dc1c67f53aa1facf5bab976ecb0
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
.pinnedto prevent stale bot from closing the issue.