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

feat: add hooks on set_perm for new data permissions #20600

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Jul 4, 2022

SUMMARY

Adds hooks for ViewMenu, Permission and PermissionView for after_insert events.
Since set_perm can't use the current SQLAlchemy session (doc: https://docs.sqlalchemy.org/en/14/orm/session_events.html#mapper-level-events)

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
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #20600 (79595b8) into master (309327d) will decrease coverage by 0.16%.
The diff coverage is 100.00%.

❗ Current head 79595b8 differs from pull request most recent head 89114f6. Consider uploading reports for the commit 89114f6 to get more accurate results

@@            Coverage Diff             @@
##           master   #20600      +/-   ##
==========================================
- Coverage   66.79%   66.63%   -0.17%     
==========================================
  Files        1754     1754              
  Lines       65565    65572       +7     
  Branches     6935     6935              
==========================================
- Hits        43793    43692     -101     
- Misses      20017    20125     +108     
  Partials     1755     1755              
Flag Coverage Δ
hive ?
mysql 82.36% <100.00%> (+<0.01%) ⬆️
postgres 82.43% <100.00%> (+<0.01%) ⬆️
presto ?
python 82.51% <100.00%> (-0.34%) ⬇️
sqlite 82.22% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/connectors/sqla/utils.py 88.63% <100.00%> (ø)
superset/security/manager.py 95.40% <100.00%> (+0.06%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/db_engine_specs/hive.py 70.00% <0.00%> (-15.77%) ⬇️
superset/db_engine_specs/presto.py 83.64% <0.00%> (-5.39%) ⬇️
superset/connectors/sqla/models.py 89.17% <0.00%> (-1.15%) ⬇️
superset/db_engine_specs/base.py 88.00% <0.00%> (-0.34%) ⬇️
superset/models/core.py 88.91% <0.00%> (-0.25%) ⬇️
superset/utils/core.py 90.09% <0.00%> (-0.12%) ⬇️
superset/views/core.py 77.38% <0.00%> (-0.08%) ⬇️

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 309327d...89114f6. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks good! If I understand correctly we're not calling these anywhere in Superset, but custom security managers will use them?

@dpgaspar
Copy link
Member Author

dpgaspar commented Jul 6, 2022

Looks good! If I understand correctly we're not calling these anywhere in Superset, but custom security managers will use them?

yes, exactly that

@dpgaspar dpgaspar merged commit f38dd1d into apache:master Jul 6, 2022
@dpgaspar dpgaspar deleted the feat/add-perms-custom-events branch July 6, 2022 08:54
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 6, 2022
* feat: add hooks on set_perm for new data permissions

* fix lint

(cherry picked from commit f38dd1d)
codyml pushed a commit to codyml/superset that referenced this pull request Jul 7, 2022
* feat: add hooks on set_perm for new data permissions

* fix lint
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 12, 2022
* feat: add hooks on set_perm for new data permissions

* fix lint

(cherry picked from commit f38dd1d)
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 12, 2022
* feat: add hooks on set_perm for new data permissions

* fix lint

(cherry picked from commit f38dd1d)
akshatsri pushed a commit to charan1314/superset that referenced this pull request Jul 19, 2022
* feat: add hooks on set_perm for new data permissions

* fix lint
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 2024
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 preset:2022.27 preset-io size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants