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(dashboard_rbac): dashboard_view access enforcement #12875

Merged
merged 12 commits into from Feb 4, 2021

Conversation

amitmiran137
Copy link
Member

@amitmiran137 amitmiran137 commented Feb 1, 2021

SUMMARY

resolves #10408

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

go to the dashboard(http://127.0.0.01/superset/dashboard//) to which you have no access (no role nor dataset access)
dashboard should not be visible and should get forbidden 403

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@amitmiran137 amitmiran137 marked this pull request as ready for review February 2, 2021 19:48
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

A couple of code style suggestions. Mostly non-blockers.

The HTML error renderer could be a large refactoring effort that'd worth a discussion thread or separate PR.

superset/models/dashboard.py Outdated Show resolved Hide resolved
superset/security/manager.py Outdated Show resolved Hide resolved
superset/security/manager.py Outdated Show resolved Hide resolved
superset/utils/decorators.py Outdated Show resolved Hide resolved
superset/views/core.py Show resolved Hide resolved
superset/models/dashboard.py Outdated Show resolved Hide resolved
tests/dashboards/security/security_rbac_tests.py Outdated Show resolved Hide resolved
tests/dashboards/security/security_rbac_tests.py Outdated Show resolved Hide resolved
tests/dashboards/security/security_rbac_tests.py Outdated Show resolved Hide resolved
tests/dashboards/security/security_rbac_tests.py Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Feb 3, 2021

Codecov Report

Merging #12875 (34deaf5) into master (51195af) will decrease coverage by 7.67%.
The diff coverage is 92.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12875      +/-   ##
==========================================
- Coverage   66.93%   59.25%   -7.68%     
==========================================
  Files        1022      966      -56     
  Lines       50186    45927    -4259     
  Branches     5204     4444     -760     
==========================================
- Hits        33591    27216    -6375     
- Misses      16455    18711    +2256     
+ Partials      140        0     -140     
Flag Coverage Δ
cypress 45.42% <ø> (-4.35%) ⬇️
javascript ?
python 67.55% <92.15%> (+3.47%) ⬆️

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

Impacted Files Coverage Δ
superset/views/core.py 74.90% <85.71%> (-0.52%) ⬇️
superset/utils/decorators.py 94.44% <86.95%> (-5.56%) ⬇️
superset/dashboards/commands/exceptions.py 100.00% <100.00%> (ø)
superset/models/dashboard.py 77.82% <100.00%> (+2.08%) ⬆️
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...t-frontend/src/dashboard/containers/SliceAdder.jsx 0.00% <0.00%> (-100.00%) ⬇️
...frontend/src/dashboard/util/dropOverflowsParent.js 0.00% <0.00%> (-100.00%) ⬇️
...frontend/src/dashboard/util/newEntitiesFromDrop.js 0.00% <0.00%> (-100.00%) ⬇️
...rontend/src/dashboard/util/componentIsResizable.ts 0.00% <0.00%> (-100.00%) ⬇️
... and 446 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 51195af...34deaf5. Read the comment docs.

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

Code LGTM. Thanks for all the updates. Just one more comment that's non-blocking, too.

Let's leave this PR open for a couple of more hours just in case others have thoughts.

superset/views/core.py Show resolved Hide resolved
@ktmud ktmud requested a review from villebro February 4, 2021 07:33
@amitmiran137 amitmiran137 reopened this Feb 4, 2021
@amitmiran137 amitmiran137 reopened this Feb 4, 2021
@srinify srinify merged commit b472d18 into apache:master Feb 4, 2021
@amitmiran137 amitmiran137 deleted the feat/single_dashboard_rbac branch February 4, 2021 18:29
@MM-Lehmann
Copy link

Unfortunately, this feature breaks my dataset-based access. I can either use dashboard level OR dataset level. I've ran a db upgrade after setting the FF as well. What went wrong? (I am on 1.4.1)

@mistercrunch mistercrunch added the 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels label Mar 12, 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 size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SIP-51] Dashboard Level Access
7 participants