-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: dataset name change and permission change #21161
fix: dataset name change and permission change #21161
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21161 +/- ##
===========================================
- Coverage 66.29% 55.03% -11.26%
===========================================
Files 1773 1784 +11
Lines 67680 68232 +552
Branches 7214 7265 +51
===========================================
- Hits 44866 37550 -7316
- Misses 20971 28813 +7842
- Partials 1843 1869 +26
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
* fix: dataset name change and permission change (cherry picked from commit 3f2e894)
🏷️ preset:2022.35 |
* fix: dataset name change and permission change
SUMMARY
Currently updating a dataset does not update or delete any associated permissions.
Dataset updates impact data permission names on
table_name
,database
andschema
.Dataset updates on the affected fields will cut user access to charts that are based on the dataset. This particularly impacts virtual datasets.
Also took the chance to refactor (split)
set_perm
to multiple SQLAlchemy events:dataset_after_insert
dataset_after_update
dataset_after_delete
database_after_insert
database_after_update
database_after_delete
This makes:
Related previous fix: #20081
Examples:
Creating a database named
db1
with 2 datasources named:(ds1, ds2)
, creates the following permissions:And a chart based on
ds1
would haveChart.perm
field equal todatasource_access -> [db1].[ds1](id:1)
Changing datasource name
ds1
tods1_changed
, would leave the permissions on the following state:But the
Chart.perm
field would be the same, so a virtual dataset name change would remove access to all related charts and dashboards to users without the all datasource permissionBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION