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): manage roles for dashboard #13145

Merged
merged 7 commits into from
Mar 3, 2021

Conversation

simcha90
Copy link
Contributor

SUMMARY

This PR add roles management to DashboardProperties modal under Feature flag

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2021-02-16.at.8.52.10.mov

TEST PLAN

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

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

This looks fine to me, but I'd love to get input from the developers who have worked more with this part of the codebase (will request reviews).

@villebro
Copy link
Member

@riahk it would be great if you could take a look at this PR!

@junlincc junlincc added the dashboard:security:access Related to the security access of the Dashboard label Feb 16, 2021
@amitmiran137
Copy link
Member

@simcha90 I found an issue when trying to remove all roles & save then it failed to save

remove_failed.mov

@willbarrett
Copy link
Member

I've added a few developers that are more familiar with this code. These add/edit modals become quite complex over time and are frequent sources of bugs in the codebase. Would it be possible to add tests for the new functionality to help reduce the likelihood of future regressions?

);
}

getRowsWithRoles() {
Copy link
Member

@lilykuang lilykuang Feb 18, 2021

Choose a reason for hiding this comment

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

getRowsWithoutRoles and getRowsWithRoles are very similar. Maybe the two functions could combine into one and use DASHBOARD_RBAC feature flag to determine AsyncSelect with role show or hidden.

Copy link
Contributor Author

@simcha90 simcha90 Feb 22, 2021

Choose a reason for hiding this comment

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

I did it first... but except of add AsyncSelect it also require changes in layout, because of it I moved to separate functions only code that requires changes of layout

…ions

� Conflicts:
�	superset-frontend/src/featureFlags.ts
…-superset into role_permissions

� Conflicts:
�	superset-frontend/src/featureFlags.ts
@simcha90
Copy link
Contributor Author

@amitmiran137 fixed, @willbarrett added

@codecov-io
Copy link

codecov-io commented Feb 22, 2021

Codecov Report

Merging #13145 (26556fc) into master (2ce7982) will increase coverage by 5.50%.
The diff coverage is 69.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13145      +/-   ##
==========================================
+ Coverage   53.06%   58.56%   +5.50%     
==========================================
  Files         489      478      -11     
  Lines       17314    16005    -1309     
  Branches     4482     4127     -355     
==========================================
+ Hits         9187     9374     +187     
+ Misses       8127     6631    -1496     
Flag Coverage Δ
cypress 58.56% <69.25%> (+5.50%) ⬆️

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

Impacted Files Coverage Δ
.../src/SqlLab/components/EstimateQueryCostButton.jsx 20.83% <ø> (ø)
...end/src/SqlLab/components/ExploreResultsButton.jsx 8.00% <ø> (ø)
...et-frontend/src/SqlLab/components/QueryHistory.jsx 50.00% <0.00%> (ø)
...erset-frontend/src/SqlLab/components/ResultSet.tsx 4.16% <0.00%> (-0.09%) ⬇️
...end/src/SqlLab/components/RunQueryActionButton.tsx 52.77% <ø> (ø)
...erset-frontend/src/SqlLab/components/SouthPane.jsx 64.10% <ø> (ø)
...end/src/SqlLab/components/TemplateParamsEditor.jsx 23.80% <ø> (ø)
superset-frontend/src/chart/Chart.jsx 57.89% <ø> (ø)
superset-frontend/src/chart/ChartContainer.jsx 100.00% <ø> (ø)
superset-frontend/src/chart/ChartRenderer.jsx 75.67% <0.00%> (-1.04%) ⬇️
... and 207 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 f85497e...26556fc. Read the comment docs.

@amitmiran137 amitmiran137 merged commit dc17039 into apache:master Mar 3, 2021
@michael-s-molina
Copy link
Member

michael-s-molina commented Mar 4, 2021

@simcha90 This change is causing the test to fail in Node 15 since in this version of Node they changed the way to handle promise rejections. In previous versions of Node, promise rejections are handled as warnings, so the test pass but that doesn't mean that the test is correct. I don't know if we support Node 15 but I'm using it in development for security reasons. Can you check what's causing the promise rejection?

Screen Shot 2021-03-04 at 11 26 26 AM

@michael-s-molina
Copy link
Member

@simcha90 This change is causing the test to fail in Node 15 since in this version of Node they changed the way to handle promise rejections. In previous versions of Node, promise rejections are handled as warnings, so the test pass but that doesn't mean that the test is correct. I don't know if we support Node 15 but I'm using it in development for security reasons. Can you check what's causing the promise rejection?

Screen Shot 2021-03-04 at 11 26 26 AM

Fixed in #13548

allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* feat(dashboard_rbac): manage roles for dashboard

* test: fix tests

* fix: fix empty roles

Co-authored-by: Amit Miran <47772523+amitmiran137@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels 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 dashboard:security:access Related to the security access of the Dashboard size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants