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: Hide nav create with RBAC #17157

Merged
merged 2 commits into from
Oct 23, 2021
Merged

feat: Hide nav create with RBAC #17157

merged 2 commits into from
Oct 23, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Oct 19, 2021

SUMMARY

Remerging #16902 since webpack issue have been resolved

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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 Oct 19, 2021

Codecov Report

Merging #17157 (9f30ebb) into master (2062775) will increase coverage by 0.14%.
The diff coverage is 85.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17157      +/-   ##
==========================================
+ Coverage   76.83%   76.98%   +0.14%     
==========================================
  Files        1038     1042       +4     
  Lines       55557    56277     +720     
  Branches     7567     7794     +227     
==========================================
+ Hits        42687    43323     +636     
- Misses      12620    12701      +81     
- Partials      250      253       +3     
Flag Coverage Δ
hive 81.45% <ø> (ø)
javascript 71.23% <85.10%> (+0.30%) ⬆️
mysql 81.91% <ø> (ø)
postgres 81.92% <ø> (ø)
presto 81.78% <ø> (?)
python 82.41% <ø> (+0.14%) ⬆️
sqlite 81.59% <ø> (ø)

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

Impacted Files Coverage Δ
superset-frontend/src/views/menu.tsx 0.00% <0.00%> (ø)
...uperset-frontend/src/components/Menu/MenuRight.tsx 92.30% <88.88%> (+1.07%) ⬆️
...nativeFilters/FiltersConfigModal/Footer/Footer.tsx 93.75% <0.00%> (-6.25%) ⬇️
.../src/explore/components/DataTableControl/index.tsx 97.53% <0.00%> (-0.47%) ⬇️
...end/src/components/Datasource/DatasourceEditor.jsx 72.10% <0.00%> (ø)
...rc/components/Datasource/ChangeDatasourceModal.tsx 86.36% <0.00%> (ø)
...erset-frontend/src/components/Datasource/index.tsx 100.00% <0.00%> (ø)
...tend/src/components/Datasource/DatasourceModal.tsx 75.38% <0.00%> (ø)
superset/models/core.py 90.00% <0.00%> (+0.73%) ⬆️
...et-frontend/src/components/TableView/TableView.tsx 95.89% <0.00%> (+1.36%) ⬆️
... and 5 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 2062775...9f30ebb. Read the comment docs.

@geido
Copy link
Member

geido commented Oct 20, 2021

/testenv up

@github-actions
Copy link
Contributor

@geido Ephemeral environment spinning up at http://52.41.104.137:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@rosemarie-chiu
Copy link
Contributor

rosemarie-chiu commented Oct 20, 2021

@hughhhh Login as user with perm for sql lab only ✅ PASSED
CleanShot 2021-10-21 at 05 40 59@2x

Login as user with perm for chart edit and read only for dashboard ❓I SEE DASHBOARD not chart ?
CleanShot 2021-10-21 at 05 43 39@2x

CleanShot 2021-10-21 at 05 42 44@2x

Did I test it wrong?

@rosemarie-chiu
Copy link
Contributor

I selected all chart permissions only and still only see dashboard in global add
CleanShot 2021-10-21 at 06 33 31@2x
CleanShot 2021-10-21 at 06 33 07@2x

@eschutho
Copy link
Member

@hughhhh this looks good. Can you check that running a query works for you? I wasn't seeing any results in the bottom section for a query or the preview, although the api was returning a response.

@hughhhh
Copy link
Member Author

hughhhh commented Oct 21, 2021

@rosemarie-chiu so the mapping is based only on writing for the 3 resources

https://github.com/apache/superset/pull/17157/files#diff-66167b483c9360910449d7ed1078df9d2b3b2500ea69295657e3692e462c9095R35-R50

So if the user has the following role it will appear in the create:
can_write Dashboard -> show dashboard
can_write Chart -> show chart
can_sqllab Superset -> show sqllab

also found a small bug and pushed it up so tested it out 1 more time when you get the chance

@hughhhh
Copy link
Member Author

hughhhh commented Oct 21, 2021

@hughhhh this looks good. Can you check that running a query works for you? I wasn't seeing any results in the bottom section for a query or the preview, although the api was returning a response.

It was working for me in the ephermeral env

Screen.Recording.2021-10-21.at.3.52.09.PM.mov

@hughhhh
Copy link
Member Author

hughhhh commented Oct 22, 2021

/testenv up

@github-actions
Copy link
Contributor

@hughhhh Ephemeral environment spinning up at http://34.221.76.192:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@rosemarie-chiu
Copy link
Contributor

tested and verified!

Copy link
Contributor

@rosemarie-chiu rosemarie-chiu left a comment

Choose a reason for hiding this comment

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

LGTM! QA sign off

@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@nytai nytai deleted the hugh/rbac-nav-remerge branch November 12, 2021 19:42
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.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 size/L 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants