You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/04/14 20:40:48 UTC

[GitHub] [superset] ktmud opened a new pull request #14148: fix(dashboard): incorrect perm for users with multiple roles

ktmud opened a new pull request #14148:
URL: https://github.com/apache/superset/pull/14148


   ### SUMMARY
   
   This fixes a bug where dashboard permission check is incorrect when users have multiple roles.
   
   The resulted some users not seeing "View chart in Explore" link in dashboards.
   
   cc @suddjian @pkdotson
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   #### Before
   
   <img width="513" alt="perm-before" src="https://user-images.githubusercontent.com/335541/114775804-92137980-9d26-11eb-86dc-c4139467bb32.png">
   
   Some links in chart menu are missing if the user has multiple roles and the last role does not contain permission for `[Superset, can_explore]`.
   
   #### After
   
   <img width="620" alt="perm-after" src="https://user-images.githubusercontent.com/335541/114775934-bc653700-9d26-11eb-922f-31f4d033c9c8.png">
   
   ### TEST PLAN
   
   To reproduce the bug, add  a new role (e.g. `sql_lab`) to the logged in user.
   
   Added unit tests.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue:  #13306 
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] edited a comment on pull request #14148: fix(dashboard): incorrect perm for users with multiple roles

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #14148:
URL: https://github.com/apache/superset/pull/14148#issuecomment-819875666


   # [Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#14148](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c270fdc) into [master](https://codecov.io/gh/apache/superset/commit/21f973f0bdcad0fe7ade33a36057f08293e66506?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21f973f) will **increase** coverage by `0.21%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head c270fdc differs from pull request most recent head 9871a83. Consider uploading reports for the commit 9871a83 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/14148/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #14148      +/-   ##
   ==========================================
   + Coverage   79.70%   79.92%   +0.21%     
   ==========================================
     Files         945      943       -2     
     Lines       47975    47757     -218     
     Branches     6082     6015      -67     
   ==========================================
   - Hits        38240    38169      -71     
   + Misses       9614     9469     -145     
   + Partials      121      119       -2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.36% <100.00%> (-0.04%)` | :arrow_down: |
   | javascript | `70.19% <80.00%> (+0.38%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `85.84% <100.00%> (ø)` | |
   | [...rset-frontend/src/dashboard/util/findPermission.ts](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2ZpbmRQZXJtaXNzaW9uLnRz) | `100.00% <100.00%> (ø)` | |
   | [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `95.23% <0.00%> (-4.77%)` | :arrow_down: |
   | [...dashboard/components/SliceHeaderControls/index.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMvaW5kZXguanN4) | `78.35% <0.00%> (-1.04%)` | :arrow_down: |
   | [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | | |
   | [...erset-frontend/src/dashboard/components/Header.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci5qc3g=) | | |
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `72.36% <0.00%> (+2.63%)` | :arrow_up: |
   | [...et-frontend/src/components/EditableTitle/index.tsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS9pbmRleC50c3g=) | `86.41% <0.00%> (+11.11%)` | :arrow_up: |
   | [...frontend/src/dashboard/components/Header/index.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9pbmRleC5qc3g=) | `81.02% <0.00%> (+13.86%)` | :arrow_up: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <0.00%> (+33.33%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [21f973f...9871a83](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud merged pull request #14148: fix(dashboard): incorrect perm for users with multiple roles

Posted by GitBox <gi...@apache.org>.
ktmud merged pull request #14148:
URL: https://github.com/apache/superset/pull/14148


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #14148: fix(dashboard): incorrect perm for users with multiple roles

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #14148:
URL: https://github.com/apache/superset/pull/14148#issuecomment-819875666


   # [Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#14148](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c270fdc) into [master](https://codecov.io/gh/apache/superset/commit/21f973f0bdcad0fe7ade33a36057f08293e66506?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21f973f) will **increase** coverage by `0.22%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head c270fdc differs from pull request most recent head 9871a83. Consider uploading reports for the commit 9871a83 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/14148/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #14148      +/-   ##
   ==========================================
   + Coverage   79.70%   79.93%   +0.22%     
   ==========================================
     Files         945      944       -1     
     Lines       47975    47764     -211     
     Branches     6082     6018      -64     
   ==========================================
   - Hits        38240    38179      -61     
   + Misses       9614     9466     -148     
   + Partials      121      119       -2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `70.19% <80.00%> (+0.38%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `85.84% <100.00%> (ø)` | |
   | [...rset-frontend/src/dashboard/util/findPermission.ts](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2ZpbmRQZXJtaXNzaW9uLnRz) | `100.00% <100.00%> (ø)` | |
   | [...rset-frontend/src/dashboard/util/getPermissions.ts](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldFBlcm1pc3Npb25zLnRz) | `100.00% <0.00%> (ø)` | |
   | [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | | |
   | [...erset-frontend/src/dashboard/components/Header.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci5qc3g=) | | |
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `72.36% <0.00%> (+2.63%)` | :arrow_up: |
   | [...et-frontend/src/components/EditableTitle/index.tsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS9pbmRleC50c3g=) | `86.41% <0.00%> (+11.11%)` | :arrow_up: |
   | [...frontend/src/dashboard/components/Header/index.jsx](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9pbmRleC5qc3g=) | `81.02% <0.00%> (+13.86%)` | :arrow_up: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/14148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <0.00%> (+33.33%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [21f973f...9871a83](https://codecov.io/gh/apache/superset/pull/14148?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #14148: fix(dashboard): incorrect perm for users with multiple roles

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #14148:
URL: https://github.com/apache/superset/pull/14148#discussion_r613572890



##########
File path: superset-frontend/package-lock.json
##########
@@ -122,7 +122,7 @@
         "regenerator-runtime": "^0.13.5",
         "rison": "^0.1.1",
         "shortid": "^2.2.6",
-        "urijs": "^1.19.4",

Review comment:
       lockfile updated from `npm ci`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org