feat: new config to filter specific users from dropdown lists
SUMMARY
Introduces a new config key named EXCLUDE_USER_USERNAMES with a list of usernames to exclude from all UI
dropdown user list, owners, created by filters etc.
This is useful for excluding service user's like an initial admin and/or the thumbnail user.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Codecov Report
Merging #21515 (0d62500) into master (7d2f07e) will increase coverage by
0.00%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #21515 +/- ##
=======================================
Coverage 66.67% 66.68%
=======================================
Files 1793 1793
Lines 68493 68513 +20
Branches 7275 7275
=======================================
+ Hits 45665 45685 +20
Misses 20966 20966
Partials 1862 1862
| Flag | Coverage Δ | |
|---|---|---|
| hive | 53.09% <80.00%> (+0.01%) |
:arrow_up: |
| mysql | 78.21% <100.00%> (+0.01%) |
:arrow_up: |
| postgres | 78.28% <100.00%> (+0.01%) |
:arrow_up: |
| presto | 52.99% <80.00%> (+0.01%) |
:arrow_up: |
| python | 81.42% <100.00%> (+0.01%) |
:arrow_up: |
| sqlite | 76.78% <100.00%> (+0.01%) |
:arrow_up: |
| unit | 51.07% <80.00%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| superset/charts/api.py | 86.03% <100.00%> (+0.05%) |
:arrow_up: |
| superset/config.py | 91.61% <100.00%> (+0.02%) |
:arrow_up: |
| superset/dashboards/api.py | 92.52% <100.00%> (+0.02%) |
:arrow_up: |
| superset/datasets/api.py | 87.29% <100.00%> (ø) |
|
| superset/queries/api.py | 100.00% <100.00%> (ø) |
|
| superset/reports/api.py | 90.22% <100.00%> (ø) |
|
| superset/security/manager.py | 95.75% <100.00%> (+0.01%) |
:arrow_up: |
| superset/views/filters.py | 100.00% <100.00%> (ø) |
|
| superset/db_engine_specs/pinot.py | 97.36% <0.00%> (ø) |
|
| superset/connectors/sqla/models.py | 90.60% <0.00%> (ø) |
|
| ... and 2 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Should this be an attribute for the User model instead, or potentially a config/method in SecurityManager (which users can already override)? We should really try our best to reduce the number of config keys added plus setting this in config would also mean new service accounts cannot be added without a new deployment of Superset.
Should this be an attribute for the
Usermodel instead, or potentially a config/method in SecurityManager (which users can already override)? We should really try our best to reduce the number of config keys added plus setting this in config would also mean new service accounts cannot be added without a new deployment of Superset.
Very good point, an extra attribute for the User model could be tricky. I've chose to do both, config key and a security manager method to override. Config key if not None will take precedence.