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

fix: dashboard ownership check #24249

Merged
merged 1 commit into from
May 30, 2023
Merged

fix: dashboard ownership check #24249

merged 1 commit into from
May 30, 2023

Conversation

betodealmeida
Copy link
Member

SUMMARY

Fix dashboard ownership check. There's currently a bug where non-admin users can't edit a dashboard (even a new one) because username was removed from the API response payload in #24056, making this check fail:

dashboard.owners.some(owner => owner.username === user.username);

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

I'm adding the tests in a separate PR, so we can cherry-pick this quickly.

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 May 30, 2023

Codecov Report

Merging #24249 (659b098) into master (674da1b) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 659b098 differs from pull request most recent head 78437f8. Consider uploading reports for the commit 78437f8 to get more accurate results

@@           Coverage Diff           @@
##           master   #24249   +/-   ##
=======================================
  Coverage   68.30%   68.30%           
=======================================
  Files        1957     1957           
  Lines       75596    75596           
  Branches     8222     8222           
=======================================
  Hits        51639    51639           
  Misses      21849    21849           
  Partials     2108     2108           
Flag Coverage Δ
javascript 54.72% <100.00%> (ø)

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

Impacted Files Coverage Δ
...set-frontend/src/dashboard/util/permissionUtils.ts 86.66% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@betodealmeida betodealmeida merged commit 7e70f19 into master May 30, 2023
betodealmeida added a commit that referenced this pull request May 30, 2023
@betodealmeida betodealmeida mentioned this pull request May 30, 2023
9 tasks
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request May 30, 2023
betodealmeida added a commit that referenced this pull request May 31, 2023
@betodealmeida
Copy link
Member Author

cc: @eschutho

kgopal492 pushed a commit to kgopal492/superset that referenced this pull request Jun 27, 2023
kgopal492 added a commit to pinterest/superset that referenced this pull request Jun 27, 2023
@eschutho eschutho added the v2.1 label Jul 11, 2023
eschutho pushed a commit that referenced this pull request Jul 11, 2023
eschutho pushed a commit that referenced this pull request Jul 12, 2023
eschutho pushed a commit that referenced this pull request Jul 20, 2023
kgopal492 added a commit to pinterest/superset that referenced this pull request Nov 14, 2023
* fix: dashboard ownership check (apache#24249)
* Change dashboard standalone mode to fix report screenshot error

---------
Co-authored-by: Beto Dealmeida <[email protected]>
@mistercrunch mistercrunch added 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 2024
@mistercrunch mistercrunch deleted the fix_dash_ownership branch March 26, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS v2.0.1 v2.1 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants