Skip to content

[security] New, deprecate merge_perm, FAB method is fixed#7355

Merged
mistercrunch merged 6 commits into
apache:masterfrom
dpgaspar:fix/merge-permissions
May 21, 2019
Merged

[security] New, deprecate merge_perm, FAB method is fixed#7355
mistercrunch merged 6 commits into
apache:masterfrom
dpgaspar:fix/merge-permissions

Conversation

@dpgaspar
Copy link
Copy Markdown
Member

@dpgaspar dpgaspar commented Apr 23, 2019

CATEGORY

  • Refactor

SUMMARY

Since FAB version 2.0.0 that safe guards made on merge_perms on Superset were included on FAB.
This makes it possible to simplify Superset's custom SecurityManager. And remove merge_perms.

Note: Only after PR #7323

ADDITIONAL INFORMATION

REVIEWERS

@dpgaspar dpgaspar changed the title [security] New, deprecate merge_perm, FAB method is fixed [WiP] [security] New, deprecate merge_perm, FAB method is fixed Apr 23, 2019
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 23, 2019

Codecov Report

Merging #7355 into master will increase coverage by 0.28%.
The diff coverage is 35.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7355      +/-   ##
==========================================
+ Coverage   64.89%   65.18%   +0.28%     
==========================================
  Files         428      433       +5     
  Lines       20937    21428     +491     
  Branches     2330     2360      +30     
==========================================
+ Hits        13588    13968     +380     
- Misses       7225     7340     +115     
+ Partials      124      120       -4
Impacted Files Coverage Δ
superset/cli.py 36.01% <ø> (+0.95%) ⬆️
superset/connectors/sqla/views.py 63.15% <0%> (ø) ⬆️
superset/connectors/druid/views.py 66.21% <0%> (ø) ⬆️
superset/views/core.py 72.92% <100%> (+0.02%) ⬆️
superset/security.py 74.77% <66.66%> (-1.42%) ⬇️
superset/views/sql_lab.py 86.95% <0%> (-7.69%) ⬇️
superset/assets/src/SqlLab/reducers/sqlLab.js 50% <0%> (-6.61%) ⬇️
superset/assets/src/SqlLab/actions/sqlLab.js 64.73% <0%> (-5.92%) ⬇️
...uperset/assets/src/SqlLab/components/SqlEditor.jsx 54.7% <0%> (-5.3%) ⬇️
superset/assets/src/chart/Chart.jsx 10.86% <0%> (-1.64%) ⬇️
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 845218d...c6bdeb6. Read the comment docs.

@dpgaspar dpgaspar changed the title [WiP] [security] New, deprecate merge_perm, FAB method is fixed [security] New, deprecate merge_perm, FAB method is fixed Apr 23, 2019
Copy link
Copy Markdown
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge after the FAB 2.0 PR is merged

Copy link
Copy Markdown
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, otherwise LGTM.

The SupersetSecurityManager API is fairly public given that in most settings people are expected to create their own security manager. Let's make sure upgrading is easy.

Comment thread superset/security.py
full_names = {d.full_name for d in user_datasources}
return [d for d in datasource_names if d in full_names]

def merge_perm(self, permission_name, view_menu_name):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backwards compatibility, we should just call self.add_permission_view_menu here and maybe add a deprecation warning.

@mistercrunch mistercrunch merged commit 74704f6 into apache:master May 21, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 First shipped in 0.34.0 labels Feb 28, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
* [security] New, deprecate merge_perm, FAB method is fixed

* [style] Fix, flakes

* [tests] Fix, change merge_perm to add_permission_view_menu

* [security] Fix, maintain merge_perm for compatibility

* [security] New, deprecation warning on merge_perm method

* [style] Fix, flake8 C812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.34.0 First shipped in 0.34.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants