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/01/22 08:35:05 UTC

[GitHub] [superset] amitmiran137 opened a new pull request #12680: Feat/dashboard access roles

amitmiran137 opened a new pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       move to [discussion](https://github.com/apache/superset/discussions/12839)




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       the factory Util enables each test to use the different creation methods for dashboards, tables, slices and etc'.
   each test uses the creation methods differently but what is common here is that each test on the teadown() runs the cleanup
   https://github.com/nielsen-oss/incubator-superset/blob/60d2d91d10401f8e6f258c88339f2a1162a355a6/tests/dashboards/security/base_case.py#L27




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `13.64%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   64.55%   50.90%   -13.65%     
   ===========================================
     Files        1018      476      -542     
     Lines       49787    17070    -32717     
     Branches     4971     4396      -575     
   ===========================================
   - Hits        32141     8690    -23451     
   + Misses      17468     8380     -9088     
   + Partials      178        0      -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...end/src/SqlLab/components/ExploreResultsButton.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0V4cGxvcmVSZXN1bHRzQnV0dG9uLmpzeA==) | `8.00% <0.00%> (-84.00%)` | :arrow_down: |
   | [...nd/src/views/CRUD/data/query/QueryPreviewModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9xdWVyeS9RdWVyeVByZXZpZXdNb2RhbC50c3g=) | `14.70% <0.00%> (-82.97%)` | :arrow_down: |
   | ... and [912 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `14.02%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   64.55%   50.53%   -14.03%     
   ===========================================
     Files        1018      476      -542     
     Lines       49787    17070    -32717     
     Branches     4971     4396      -575     
   ===========================================
   - Hits        32141     8626    -23515     
   + Misses      17468     8444     -9024     
   + Partials      178        0      -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.53% <ø> (+13.32%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...end/src/SqlLab/components/ExploreResultsButton.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0V4cGxvcmVSZXN1bHRzQnV0dG9uLmpzeA==) | `8.00% <0.00%> (-84.00%)` | :arrow_down: |
   | [...nd/src/views/CRUD/data/query/QueryPreviewModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9xdWVyeS9RdWVyeVByZXZpZXdNb2RhbC50c3g=) | `14.70% <0.00%> (-82.97%)` | :arrow_down: |
   | ... and [912 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (c560de8) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.09%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.65%   +2.09%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49811      +24     
     Branches     4971     5007      +36     
   ==========================================
   + Hits        32141    33200    +1059     
   + Misses      17468    16488     -980     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.66% <45.00%> (-0.47%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.04% <0.00%> (-0.82%)` | :arrow_down: |
   | [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.31% <0.00%> (+0.16%)` | :arrow_up: |
   | ... and [132 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0b869a2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `0.93%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.62%   -0.94%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    30003   -19784     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19090   -13051     
   + Misses      17468    10913    -6555     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.62% <45.00%> (-0.51%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `89.79% <0.00%> (-2.05%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `87.22% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/views/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.85% <0.00%> (-0.45%)` | :arrow_down: |
   | ... and [534 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (4059cdb) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.05%`.
   > The diff coverage is `80.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.18%   +8.05%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19930   -30102     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14188   -17399     
   + Misses      18245     5614   -12631     
   + Partials      200      128      -72     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.51% <0.00%> (?)` | |
   | javascript | `61.69% <80.00%> (+0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <ø> (ø)` | |
   | [...ents/controls/FilterControl/AdhocFilterControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9GaWx0ZXJDb250cm9sL0FkaG9jRmlsdGVyQ29udHJvbC5qc3g=) | `63.63% <0.00%> (+5.85%)` | :arrow_up: |
   | [...Control/AdhocFilterEditPopoverSimpleTabContent.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9GaWx0ZXJDb250cm9sL0FkaG9jRmlsdGVyRWRpdFBvcG92ZXJTaW1wbGVUYWJDb250ZW50LmpzeA==) | `79.13% <100.00%> (+0.15%)` | :arrow_up: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <100.00%> (-0.25%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | ... and [668 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...e7a4770](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `5.69%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   58.86%   -5.70%     
   ==========================================
     Files        1018      964      -54     
     Lines       49787    47130    -2657     
     Branches     4971     4396     -575     
   ==========================================
   - Hits        32141    27744    -4397     
   - Misses      17468    19386    +1918     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `63.38% <50.00%> (-0.75%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | ... and [459 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (903e3ba) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `3.99%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   59.14%   -4.00%     
   ==========================================
     Files        1022      965      -57     
     Lines       50032    47309    -2723     
     Branches     4915     4436     -479     
   ==========================================
   - Hits        31587    27979    -3608     
   - Misses      18245    19330    +1085     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.86% <ø> (?)` | |
   | javascript | `?` | |
   | python | `63.84% <50.00%> (-0.25%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | ... and [467 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...903e3ba](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/base_tests.py
##########
@@ -149,7 +150,11 @@ def create_user_with_roles(username: str, roles: List[str]):
             db.session.commit()
             user_to_create = security_manager.find_user(username)
             assert user_to_create
-        user_to_create.roles = [security_manager.find_role(r) for r in roles]
+        user_to_create.roles = []
+        for chosen_user_role in roles:
+            if copy_roles:
+                security_manager.copy_role("Gamma", chosen_user_role, False)

Review comment:
       I think in a real use case, the roles users created will also not need to copy over all gamma permission. It will just contain some metadata about what user group this role represents (currently only configurable via role name). Copying permissions between roles should be avoided if possible since users can already have multiple roles.
   
   @dpgaspar what do you think? 




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       after deep diving in the differences between alerts and dashboard I noticed that alerts are being tests more like unit tests and dashboard security needs to be tests like integration tests .
   to fully test we need the ability to tests against the http layer and to perform common actions like login and and other http calls which will need many abilities that comes out of the box in **SupersetTestCase** 
   we will need to add test utils for functionall pytest in order support what currently exists. on class based test
   




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       moved to a [discussion](https://github.com/apache/superset/discussions/12838) 




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `2.02%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   62.53%   -2.03%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49902     +115     
     Branches     4971     4888      -83     
   ==========================================
   - Hits        32141    31204     -937     
   - Misses      17468    18498    +1030     
   - Partials      178      200      +22     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.59% <50.00%> (-0.54%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (9c0b6a6) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.68%   -1.46%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19913   -30119     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12283   -19304     
   + Misses      18245     7430   -10815     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | | |
   | [superset/migrations/versions/c18bd4186f15\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9jMThiZDQxODZmMTVfLnB5) | | |
   | [superset/examples/tabbed\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvdGFiYmVkX2Rhc2hib2FyZC5weQ==) | | |
   | [...rset/migrations/versions/43df8de3a5f4\_dash\_json.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy80M2RmOGRlM2E1ZjRfZGFzaF9qc29uLnB5) | | |
   | [superset/db\_engine\_specs/gsheets.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2dzaGVldHMucHk=) | | |
   | [superset/reports/notifications/email.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL2VtYWlsLnB5) | | |
   | [...igrations/versions/c5756bec8b47\_time\_grain\_sqla.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9jNTc1NmJlYzhiNDdfdGltZV9ncmFpbl9zcWxhLnB5) | | |
   | [superset/dao/exceptions.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFvL2V4Y2VwdGlvbnMucHk=) | | |
   | ... and [477 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...9c0b6a6](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (90a32fd) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `22.48%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   40.64%   -22.49%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17129    -32903     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     6962    -24625     
   + Misses      18245    10167     -8078     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `40.64% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...frontend/src/dashboard/util/dropOverflowsParent.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Ryb3BPdmVyZmxvd3NQYXJlbnQuanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...frontend/src/dashboard/util/newEntitiesFromDrop.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL25ld0VudGl0aWVzRnJvbURyb3AuanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rontend/src/dashboard/util/componentIsResizable.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NvbXBvbmVudElzUmVzaXphYmxlLnRz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...tend/src/dashboard/util/getDirectPathToTabIndex.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERpcmVjdFBhdGhUb1RhYkluZGV4Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rc/dashboard/util/getLayoutComponentFromChartId.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldExheW91dENvbXBvbmVudEZyb21DaGFydElkLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...nd/src/dashboard/util/getComponentWidthFromDrop.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldENvbXBvbmVudFdpZHRoRnJvbURyb3AuanM=) | `0.00% <0.00%> (-95.66%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | ... and [933 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...e7a4770](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.18%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.31%   +4.18%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50991     +959     
     Branches     4915     4966      +51     
   ==========================================
   + Hits        31587    34325    +2738     
   + Misses      18245    16541    -1704     
   + Partials      200      125      -75     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.75% <ø> (+0.07%)` | :arrow_up: |
   | python | `64.59% <50.00%> (+0.50%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)

Review comment:
       how would the syntax would look like can you provide an example?
   




----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: superset/views/dashboard/mixin.py
##########
@@ -62,6 +63,11 @@ class DashboardMixin:  # pylint: disable=too-few-public-methods
             "want to alter specific parameters."
         ),
         "owners": _("Owners is a list of users who can alter the dashboard."),
+        "roles": _(
+            "Roles is a list which defines access to the dashboard. "
+            "these roles are always applied in addition to data access leve. "
+            "if no roles then dashboard is available for all roles"

Review comment:
       ```suggestion
               "Roles is a list which defines access to the dashboard. "
               "These roles are always applied in addition to restrictions on dataset level access. "
               "If no roles defined then the dashboard is available to all roles."
   ```
   

##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       I recently added a [`db_insert_temp_object`](https://github.com/apache/superset/blob/2c2ade827f8f9bfb089efab1c7e3a143fa691fe5/tests/base_tests.py#L528) helper, which uses `contextmanager` to automatically delete a temporarily inserted object when the test exists (regardless of test failure or not). I think this is a safer approach as manual deletion called later may fail to execute if some intermediate steps failed.
   
   Do you think it would be worth taking a similar approach for these ids?
   
   Maybe we can extend `db_insert_temp_object` to allow inserting an array of objects at once?

##########
File path: superset/dashboards/filters.py
##########
@@ -107,9 +119,14 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),
             )
         )
 
         return query
+
+    @staticmethod
+    def has_no_role_based_access() -> bool:

Review comment:
       This could probably also be changed to an inline variable as opposed to a static method.
   
   In general, unless a function needs to me exposed as a convenient public API, I'd recommend avoid using static methods, so to keep things local.

##########
File path: superset/dashboards/filters.py
##########
@@ -107,9 +119,14 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),
             )
         )
 
         return query
+
+    @staticmethod
+    def has_no_role_based_access() -> bool:

Review comment:
       nit: we should avoid negation in function methods, to [avoid future double negatives](https://www.gymglish.com/en/gymglish/english-grammar/avoiding-double-negative-constructions), i.e.
   
   ```
   not self.has_role_based_access()
   self.has_role_based_access()
   ```
   
   Reads nicer than
   
   ```
   self.has_no_role_based_access()
   not self.has_no_role_based_access()
   ```

##########
File path: tests/base_tests.py
##########
@@ -289,19 +294,39 @@ def get_access_requests(self, username, ds_type, ds_id):
     def logout(self):
         self.client.get("/logout/", follow_redirects=True)
 
+    def grant_access_to_dashboard(self, dashboard, role_name):
+        role = security_manager.find_role(role_name)
+        dashboard.roles.append(role)
+        db.session.merge(dashboard)
+        db.session.commit()

Review comment:
       These class methods can probably be moved to functions somewhere since they don't rely on `self`.

##########
File path: tests/base_tests.py
##########
@@ -149,7 +150,11 @@ def create_user_with_roles(username: str, roles: List[str]):
             db.session.commit()
             user_to_create = security_manager.find_user(username)
             assert user_to_create
-        user_to_create.roles = [security_manager.find_role(r) for r in roles]
+        user_to_create.roles = []
+        for chosen_user_role in roles:
+            if copy_roles:
+                security_manager.copy_role("Gamma", chosen_user_role, False)

Review comment:
       The name `copy_roles` is a little confusing considering you are just copying `Gamma` permissions to the roles over to the new roles you are creating. Considering multiple roles can be added to a user, what you want is probably something like this:
   
   ```python
       def create_user_with_roles(
           username: str, roles: List[str], include_gamma_role: bool = True
       ):
             ...
             user_to_create.roles = (
                 [security_manager.find_role("Gamma")]
                 if include_gamma_role else []
             ) + [security_manager.find_role(r) for r in roles]
   ```

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       What's the benefit of testing favorited dashboards separately? Do we expect a risk that favorites somehow wouldn't be accessible?

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)
+
+    def test_get_dashboards__user_can_not_view_unpublished_dash(self):
+        # arrange
+        admin_user = security_manager.find_user(ADMIN_USERNAME)
+        gamma_user = security_manager.find_user(GAMMA_USERNAME)
+        slug = f"admin_owned_unpublished_dash_{random_slug()}"
+
+        admin_and_not_published_dashboard = create_dashboard_to_db(
+            "My Dashboard", slug=slug, owners=[admin_user]
+        )
+
+        self.login(gamma_user.username)
+
+        # act - list dashboards as a gamma user
+        get_dashboards_response_as_gamma = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(
+            admin_and_not_published_dashboard.url, get_dashboards_response_as_gamma
+        )
+
+    @pytest.mark.usefixtures("load_energy_table_with_slice", "load_dashboard")
+    def test_get_dashboards__users_can_view_permitted_dashboard(self):
+        # arrange
+        username = random_str()
+        new_role = f"role_{random_str()}"
+        self.create_user_with_roles(username, [new_role], copy_roles=True)
+        accessed_table = get_sql_table_by_name("energy_usage")
+        self.grant_role_access_to_table(accessed_table, new_role)
+        # get a slice from the allowed table
+        slice_to_add_to_dashboards = get_slice_by_name("Energy Sankey")
+        # Create a published and hidden dashboard and add them to the database
+        first_dash = create_dashboard_to_db(
+            dashboard_title="Published Dashboard",
+            slug=f"first_dash_{random_slug()}",
+            published=True,
+            slices=[slice_to_add_to_dashboards],
+        )
+
+        second_dash = create_dashboard_to_db(
+            dashboard_title="Hidden Dashboard",
+            slug=f"second_dash_{random_slug()}",
+            published=True,
+            slices=[slice_to_add_to_dashboards],
+        )
+
+        try:
+            self.login(username)
+            # act
+            get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+            # assert
+            self.assertIn(second_dash.url, get_dashboards_response)
+            self.assertIn(first_dash.url, get_dashboards_response)
+        finally:
+            self.revoke_public_access_to_table(accessed_table)
+
+    @staticmethod
+    def __add_dashboard_mode_params(dashboard_url):

Review comment:
       Could you shed light on where is this function being used and why was it defined in two places?

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit

Review comment:
       Is this for debugging?

##########
File path: tests/dashboards/security/base_case.py
##########
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import List, Optional
+
+from flask import escape, Response
+
+from superset.models.dashboard import Dashboard
+from tests.dashboards.base_case import DashboardTestCase
+
+DASHBOARD_COUNT_IN_DASHBOARDS_LIST_VIEW_FORMAT = "Record Count:</strong> {count}"

Review comment:
       I'm not sure about the value of making this a constant. And why does it have only the closing mark for `<strong>`?

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",

Review comment:
       What's the benefit of adding a slug here? I thought they were optional.




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       actually for a reason which is unclear to me access to fav dashboards is managed just by setting the fav.
   even without any data/role access
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L106
   is it a mistake? 
   
   I also see here the filters just favs  are not being based on access control
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L48




----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (906fb50) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.68%   -1.46%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19913   -30119     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12283   -19304     
   + Misses      18245     7430   -10815     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [...t/migrations/versions/ca69c70ec99b\_tracking\_url.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9jYTY5YzcwZWM5OWJfdHJhY2tpbmdfdXJsLnB5) | | |
   | [superset/examples/flights.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvZmxpZ2h0cy5weQ==) | | |
   | [...ns/versions/73fd22e742ab\_add\_dynamic\_plugins\_py.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83M2ZkMjJlNzQyYWJfYWRkX2R5bmFtaWNfcGx1Z2luc19weS5weQ==) | | |
   | [superset/migrations/versions/979c03af3341\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy85NzljMDNhZjMzNDFfLnB5) | | |
   | [.../versions/a6c18f869a4e\_query\_start\_running\_time.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9hNmMxOGY4NjlhNGVfcXVlcnlfc3RhcnRfcnVubmluZ190aW1lLnB5) | | |
   | [...ions/bf706ae5eb46\_cal\_heatmap\_metric\_to\_metrics.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9iZjcwNmFlNWViNDZfY2FsX2hlYXRtYXBfbWV0cmljX3RvX21ldHJpY3MucHk=) | | |
   | [...a74826\_add\_metadata\_column\_to\_annotation\_model\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy81NWU5MTBhNzQ4MjZfYWRkX21ldGFkYXRhX2NvbHVtbl90b19hbm5vdGF0aW9uX21vZGVsXy5weQ==) | | |
   | [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | | |
   | ... and [477 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...906fb50](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] junlincc commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-770335851


   <img width="2046" alt="Screen Shot 2021-01-30 at 10 36 57 PM" src="https://user-images.githubusercontent.com/67837651/106376605-d14b4480-634b-11eb-9563-da636da95136.png">
   
   Settings menu is missing from the page, is it by design? 


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2c2ade8) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.59%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.72%   +0.59%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30158   -19874     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19219   -12368     
   + Misses      18245    10939    -7306     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.72% <50.00%> (-0.37%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.04% <0.00%> (-0.82%)` | :arrow_down: |
   | ... and [542 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2c2ade8](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -107,9 +119,14 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),
             )
         )
 
         return query
+
+    @staticmethod
+    def has_no_role_based_access() -> bool:

Review comment:
       This could probably also be changed to an inline variable as opposed to a static method.
   
   In general, unless a function needs to be exposed as a convenient public API, I'd recommend avoid using static methods, so to keep things local.




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.17%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.30%   +4.17%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50985     +953     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    34316    +2729     
   + Misses      18245    16545    -1700     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.59% <50.00%> (+0.50%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (b4d2cbb) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.25%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.39%   +8.25%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19932   -30100     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14230   -17357     
   + Misses      18245     5578   -12667     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.87% <ø> (?)` | |
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | | |
   | ... and [668 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...906fb50](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (b4d2cbb) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.68%   -1.46%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19913   -30119     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12283   -19304     
   + Misses      18245     7430   -10815     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/annotation\_layers/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYW5ub3RhdGlvbl9sYXllcnMvY29tbWFuZHMvdXBkYXRlLnB5) | | |
   | [superset/views/schedules.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3Mvc2NoZWR1bGVzLnB5) | | |
   | [superset/tasks/scheduler.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdGFza3Mvc2NoZWR1bGVyLnB5) | | |
   | [superset/dashboards/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy91cGRhdGUucHk=) | | |
   | [...8ee127d0d1d\_reconvert\_legacy\_filters\_into\_adhoc.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83OGVlMTI3ZDBkMWRfcmVjb252ZXJ0X2xlZ2FjeV9maWx0ZXJzX2ludG9fYWRob2MucHk=) | | |
   | [...ions/versions/ea396d202291\_ctas\_method\_in\_query.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9lYTM5NmQyMDIyOTFfY3Rhc19tZXRob2RfaW5fcXVlcnkucHk=) | | |
   | [...versions/0c5070e96b57\_add\_user\_attributes\_table.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8wYzUwNzBlOTZiNTdfYWRkX3VzZXJfYXR0cmlidXRlc190YWJsZS5weQ==) | | |
   | [superset/tasks/schedules.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdGFza3Mvc2NoZWR1bGVzLnB5) | | |
   | ... and [477 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...b4d2cbb](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -107,8 +121,9 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),

Review comment:
       nit: typo `datasource_perm_query`

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)

Review comment:
       nit: we are currently preferring `assert in get_dashboards_response`

##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       Currently there is a mix of patterns on fixture creation on our test codebase. I think that the pytest fixture and test parameters bring a lot of value, and it's always preferable to have an expected pattern. Different creation methods keep things DRY, but that's also possible using pytest fixtures, heres a simple example: https://github.com/apache/superset/blob/master/tests/reports/commands_tests.py#L132
   

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       This is a good point, might be some legacy logic, removing it is a breaking so it get perpetuated. Maybe @betodealmeida can help with more context? 

##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []
+
+
+def create_dashboard_to_db(
+    dashboard_title: Optional[str] = None,
+    slug: Optional[str] = None,
+    published: bool = False,
+    owners: Optional[List[User]] = None,
+    slices: Optional[List[Slice]] = None,
+    css: str = "",
+    json_metadata: str = "",
+    position_json: str = "",
+) -> Dashboard:
+    dashboard = create_dashboard(
+        dashboard_title,
+        slug,
+        published,
+        owners,
+        slices,
+        css,
+        json_metadata,
+        position_json,
+    )
+
+    insert_model(dashboard)
+    inserted_dashboards_ids.append(dashboard.id)
+    return dashboard
+
+
+def create_dashboard(
+    dashboard_title: Optional[str] = None,
+    slug: Optional[str] = None,
+    published: bool = False,
+    owners: Optional[List[User]] = None,
+    slices: Optional[List[Slice]] = None,
+    css: str = "",
+    json_metadata: str = "",
+    position_json: str = "",
+) -> Dashboard:
+    dashboard_title = dashboard_title or random_title()
+    slug = slug or random_slug()
+    owners = owners or []
+    slices = slices or []
+    return Dashboard(
+        dashboard_title=dashboard_title,
+        slug=slug,
+        published=published,
+        owners=owners,
+        css=css,
+        position_json=position_json,
+        json_metadata=json_metadata,
+        slices=slices,
+    )
+
+
+def insert_model(dashboard: Model) -> None:
+    session.add(dashboard)
+    session.commit()
+    session.refresh(dashboard)
+
+
+def create_slice_to_db(
+    name: Optional[str] = None,
+    datasource_id: Optional[int] = None,
+    owners: Optional[List[User]] = None,
+) -> Slice:
+    slice_ = create_slice(datasource_id, name, owners)
+    insert_model(slice_)
+    inserted_slices_ids.append(slice_.id)
+    return slice_
+
+
+def create_slice(datasource_id, name, owners):

Review comment:
       nit: missing type annotations

##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)

Review comment:
       This test creates 2 dashboards, we should delete them after the test runs. Can we use a pytest fixture here?

##########
File path: superset/dashboards/filters.py
##########
@@ -74,12 +75,14 @@ def apply(self, query: Query, value: Any) -> Query:
 
         datasource_perms = security_manager.user_view_menu_names("datasource_access")
         schema_perms = security_manager.user_view_menu_names("schema_access")
-        published_dash_query = (
+        dashboard_has_roles = Dashboard.roles.any()
+        datesource_perm_query = (

Review comment:
       nit: typo `datasource_perm_query`




----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/base_tests.py
##########
@@ -149,7 +150,11 @@ def create_user_with_roles(username: str, roles: List[str]):
             db.session.commit()
             user_to_create = security_manager.find_user(username)
             assert user_to_create
-        user_to_create.roles = [security_manager.find_role(r) for r in roles]
+        user_to_create.roles = []
+        for chosen_user_role in roles:
+            if copy_roles:
+                security_manager.copy_role("Gamma", chosen_user_role, False)

Review comment:
       The name `copy_roles` is a little confusing considering you are just copying `Gamma` permissions over to the new roles. Since a user can have multiple roles, what you wanted is probably something like this:
   
   ```python
       def create_user_with_roles(
           username: str, roles: List[str], include_gamma_role: bool = True
       ):
             ...
             user_to_create.roles = (
                 [security_manager.find_role("Gamma")]
                 if include_gamma_role else []
             ) + [security_manager.find_role(r) for r in roles]
   ```




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.44%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.57%   +3.44%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50073      +41     
     Branches     4915     4914       -1     
   ==========================================
   + Hits        31587    33337    +1750     
   + Misses      18245    16612    -1633     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.92% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `63.38% <50.00%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | ... and [213 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-766548269


   > can you vote please so we can move forward with this in a non-POC approach?
   
   Just saw it has passed. :D  Didn't notice you've updated the SIP summary. Thanks for iterating on your proposal and creating this POC!
   
   @dpgaspar's diagram makes perfect sense to me. Looks like things can be even simpler than I original thought. Maybe include the diagram in the SIP as a reference, too?


----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       > I've looked into alerts_tests.py
   > I understand its usefulles use by parameterizing the scenarios and I like it.
   > but, it seems to be using
   > https://docs.pytest.org/en/stable/yieldfixture.html
   > which seems to be deprecated
   > is it still the right way to go?
   
   Oh, you're right, those are using the deprecated pattern. Should be possible to just replace `yield_fixture` with `fixture` (I can open a PR to clean those up).




----------------------------------------------------------------
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] amitmiran137 commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765341484


   > Could you add a test plan and maybe some test cases?
   > 
   > I think we should at least test visiting the dashboards list page as each of the following:
   > 
   > 1. an anonymous user
   > 2. a non-admin (test user: alpha/general)
   > 3. admin
   
   I've those to the test plan.
   I plan to start implementing the tests once we [vote](https://lists.apache.org/thread.html/r91c0acde742a9a719a30938d708e945890ade944ea476dc1def61975%40%3Cdev.superset.apache.org%3E) for the SIP is approved.
   can you vote please so we. can move forward with this in a non-POC approach?


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.09%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.65%   +2.09%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49811      +24     
     Branches     4971     4877      -94     
   ==========================================
   + Hits        32141    33200    +1059     
   + Misses      17468    16488     -980     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.66% <45.00%> (-0.47%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.04% <0.00%> (-0.82%)` | :arrow_down: |
   | [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.31% <0.00%> (+0.16%)` | :arrow_up: |
   | ... and [132 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.92%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.05%   +3.92%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33852    +2265     
   + Misses      18245    16507    -1738     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.13% <50.00%> (+0.04%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `96.42% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/result\_set.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.69% <0.00%> (-1.66%)` | :arrow_down: |
   | ... and [203 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-766548269


   > can you vote please so we can move forward with this in a non-POC approach?
   
   Just saw it has passed. :D  Didn't notice you've updated the SIP summary. Thanks for iterating on your proposal.
   
   @dpgaspar's diagram makes perfect sense to me. Looks like things can be even simpler than I original thought. Maybe include the diagram in the SIP as a reference, too?


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.43%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.69%   -1.44%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19911   -30121     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12284   -19303     
   + Misses      18245     7427   -10818     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/datasets/commands/refresh.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvcmVmcmVzaC5weQ==) | | |
   | [superset/examples/helpers.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvaGVscGVycy5weQ==) | | |
   | [...igrations/versions/ad82a75afd82\_add\_query\_model.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9hZDgyYTc1YWZkODJfYWRkX3F1ZXJ5X21vZGVsLnB5) | | |
   | [superset/security/analytics\_db\_safety.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvYW5hbHl0aWNzX2RiX3NhZmV0eS5weQ==) | | |
   | [superset/datasets/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvaW1wb3J0ZXJzL3YwLnB5) | | |
   | [...ons/versions/67a6ac9b727b\_update\_spatial\_params.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy82N2E2YWM5YjcyN2JfdXBkYXRlX3NwYXRpYWxfcGFyYW1zLnB5) | | |
   | [superset/views/tags.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvdGFncy5weQ==) | | |
   | [superset/utils/screenshots.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvc2NyZWVuc2hvdHMucHk=) | | |
   | ... and [479 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.61%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.74%   +3.61%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33499    +1912     
   + Misses      18245    16548    -1697     
   + Partials      200      139      -61     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.45% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [219 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       actually for a reason which is unclear to me access to fav dashboards is managed just by setting the fav.
   even without any data/role access
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L106
   
   is it a mistake?
   bc we already have the 
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L48
   which handles filters favs on top of access
   




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (b4d2cbb) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.04%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.17%   +8.04%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19932   -30100     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14187   -17400     
   + Misses      18245     5617   -12628     
   + Partials      200      128      -72     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.50% <ø> (?)` | |
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/annotation\_layers/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYW5ub3RhdGlvbl9sYXllcnMvY29tbWFuZHMvdXBkYXRlLnB5) | | |
   | ... and [667 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...906fb50](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769871009


   > Also just an heads up that this implementation will need some follow up work so that the new REACT/CRUD views include the `roles` field also, @benceorlai.
   
   Already agreed about a design with @mihir174 and will implement on followup PR


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.85%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.98%   +3.85%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33618    +2031     
   + Misses      18245    16433    -1812     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.82% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.98% <60.86%> (-0.11%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.25% <0.00%> (-6.28%)` | :arrow_down: |
   | [...hboard/components/nativeFilters/CascadePopover.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvQ2FzY2FkZVBvcG92ZXIudHN4) | `18.18% <0.00%> (-4.46%)` | :arrow_down: |
   | [...terControl/AdhocFilterEditPopoverSqlTabContent.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9GaWx0ZXJDb250cm9sL0FkaG9jRmlsdGVyRWRpdFBvcG92ZXJTcWxUYWJDb250ZW50LmpzeA==) | `63.33% <0.00%> (-2.19%)` | :arrow_down: |
   | ... and [217 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769007188


   I must add that I tried forcing the fixture approach here by trying to have a "create new user" fixture  for every test but it seems like I can't get the user created as an inject parameter to the test method bc we uses class based testing and not purely pytest in native syntax 
   The fixtures superset is using focus on the setup/teardown events but they don't provide a way to inject parameter to test methods 


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ff92508) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.68%   -1.46%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19915   -30117     
     Branches     4915     4915              
   ==========================================
   - Hits        31587    12284   -19303     
   + Misses      18245     7431   -10814     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.68% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/utils/pandas\_postprocessing.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nLnB5) | | |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | | |
   | [...a45e\_form\_strip\_leading\_and\_trailing\_whitespace.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8yNThiNTI4MGE0NWVfZm9ybV9zdHJpcF9sZWFkaW5nX2FuZF90cmFpbGluZ193aGl0ZXNwYWNlLnB5) | | |
   | [superset/errors.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXJyb3JzLnB5) | | |
   | [superset/tasks/thumbnails.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdGFza3MvdGh1bWJuYWlscy5weQ==) | | |
   | [superset/utils/log.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvbG9nLnB5) | | |
   | [...ns/978245563a02\_migrate\_iframe\_to\_dash\_markdown.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy85NzgyNDU1NjNhMDJfbWlncmF0ZV9pZnJhbWVfdG9fZGFzaF9tYXJrZG93bi5weQ==) | | |
   | [...uperset/databases/commands/importers/dispatcher.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2ltcG9ydGVycy9kaXNwYXRjaGVyLnB5) | | |
   | [superset/datasets/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvZmlsdGVycy5weQ==) | | |
   | [...ions/versions/4500485bde7d\_allow\_run\_sync\_async.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy80NTAwNDg1YmRlN2RfYWxsb3dfcnVuX3N5bmNfYXN5bmMucHk=) | | |
   | ... and [475 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...c8fadb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (af5d30f) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.68%   -1.46%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19913   -30119     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12283   -19304     
   + Misses      18245     7430   -10815     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/db\_engine\_specs/\_\_init\_\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL19faW5pdF9fLnB5) | | |
   | [superset/annotation\_layers/annotations/schemas.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYW5ub3RhdGlvbl9sYXllcnMvYW5ub3RhdGlvbnMvc2NoZW1hcy5weQ==) | | |
   | [superset/views/alerts.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvYWxlcnRzLnB5) | | |
   | [.../migrations/versions/bddc498dd179\_adhoc\_filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9iZGRjNDk4ZGQxNzlfYWRob2NfZmlsdGVycy5weQ==) | | |
   | [superset/migrations/versions/d39b1e37131d\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9kMzliMWUzNzEzMWRfLnB5) | | |
   | [superset/views/database/validators.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvdmFsaWRhdG9ycy5weQ==) | | |
   | [...migrations/versions/836c0bf75904\_cache\_timeouts.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy84MzZjMGJmNzU5MDRfY2FjaGVfdGltZW91dHMucHk=) | | |
   | [superset/models/dynamic\_plugins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2R5bmFtaWNfcGx1Z2lucy5weQ==) | | |
   | ... and [477 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...af5d30f](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765383546


   I like this approach, IMO we should move to adding database, datasets and charts to this pattern also. I personally would like to deprecate string based permissions constructed based on the dataset.name and dataset.id for example
   
   ![Blank diagram (6)](https://user-images.githubusercontent.com/4025227/105494222-6302e400-5cb2-11eb-8f0d-6a609d73cc6c.png)
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/migrations/versions/11ccdd12658_add_roles_relationship_to_dashboard.py
##########
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""add roles relationship to dashboard
+Revision ID: e11ccdd12658
+Revises: c878781977c6
+Create Date: 2021-01-14 19:12:43.406230
+"""
+# revision identifiers, used by Alembic.
+revision = "e11ccdd12658"
+down_revision = "c878781977c6"
+import sqlalchemy as sa
+from alembic import op
+
+
+def upgrade():
+    op.create_table(
+        "dashboard_roles",
+        sa.Column("id", sa.Integer(), nullable=False),
+        sa.Column("role_id", sa.Integer(), nullable=False),
+        sa.Column("dashboard_id", sa.Integer(), nullable=True),
+        sa.ForeignKeyConstraint(["dashboard_id"], ["dashboards.id"]),
+        sa.ForeignKeyConstraint(["role_id"], ["ab_role.id"]),
+        sa.PrimaryKeyConstraint("id"),
+    )
+
+    pass

Review comment:
       Not sure what you mean.
   Can you suggest a correction ?




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `1.97%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.52%   +1.97%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49921     +134     
     Branches     4971     4888      -83     
   ==========================================
   + Hits        32141    33212    +1071     
   + Misses      17468    16580     -888     
   + Partials      178      129      -49     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.53% <ø> (+13.32%)` | :arrow_up: |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.63% <50.00%> (-0.50%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `82.60% <0.00%> (-8.09%)` | :arrow_down: |
   | [superset-frontend/src/reduxUtils.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3JlZHV4VXRpbHMudHM=) | `70.88% <0.00%> (-7.60%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | ... and [145 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.07%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.20%   +4.07%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33929    +2342     
   + Misses      18245    16430    -1815     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.39% <50.00%> (+0.29%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ac45a58) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.70%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.83%   +3.70%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33542    +1955     
   + Misses      18245    16509    -1736     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.82% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [220 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...ac45a58](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)

Review comment:
       I saw that and actually deleted this comment :P nevermind 




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (9c0b6a6) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.26%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.39%   +8.26%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19932   -30100     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14231   -17356     
   + Misses      18245     5577   -12668     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.88% <ø> (?)` | |
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | | |
   | ... and [668 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...9c0b6a6](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2826b77) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.13%`.
   > The diff coverage is `47.05%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   62.99%   -0.14%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50137     +105     
     Branches     4915     5198     +283     
   ==========================================
   - Hits        31587    31585       -2     
   - Misses      18245    18337      +92     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.99% <ø> (+0.31%)` | :arrow_up: |
   | python | `63.65% <47.05%> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [53 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2826b77](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -107,8 +121,9 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),

Review comment:
       While this logic is fairly straight forward, due to this being very critical security logic, I'd prefer to place these changes behind a FF until it has been established to be fully safe.




----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -89,6 +97,19 @@ def apply(self, query: Query, value: Any) -> Query:
             )
         )
 
+
+        roles_based_query = (
+            db.session.query(Dashboard.id)
+            .join(Dashboard.roles)
+            .filter(
+                and_(
+                    Dashboard.published.is_(True),
+                    dashboard_has_roles,
+                    Role.id.in_([x.id for x in get_user_roles()]),
+                ),
+            )
+        )

Review comment:
       this can be moved into the if-statement

##########
File path: superset/dashboards/filters.py
##########
@@ -104,11 +125,17 @@ def apply(self, query: Query, value: Any) -> Query:
             )
         )
 
+        dashboard_rbac_or_filters = []
+        if is_feature_enabled("DASHBOARD_RBAC"):
+            dashboard_rbac_or_filters.append(Dashboard.id.in_(roles_based_query))
+
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datasource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),

Review comment:
       This should be removed (already in `dashboard_rbac_or_filters`):
   ```suggestion
   ```




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (903e3ba) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `3.99%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   59.13%   -4.00%     
   ==========================================
     Files        1022      965      -57     
     Lines       50032    47309    -2723     
     Branches     4915     4436     -479     
   ==========================================
   - Hits        31587    27978    -3609     
   - Misses      18245    19331    +1086     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.86% <ø> (?)` | |
   | javascript | `?` | |
   | python | `63.84% <50.00%> (-0.26%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | ... and [468 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...903e3ba](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/base_tests.py
##########
@@ -149,7 +150,11 @@ def create_user_with_roles(username: str, roles: List[str]):
             db.session.commit()
             user_to_create = security_manager.find_user(username)
             assert user_to_create
-        user_to_create.roles = [security_manager.find_role(r) for r in roles]
+        user_to_create.roles = []
+        for chosen_user_role in roles:
+            if copy_roles:
+                security_manager.copy_role("Gamma", chosen_user_role, False)

Review comment:
       maybe.  now it is clearer?




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       the factory Util enables each test to use the different creation methods for dashboards, tables, slices and etc'.
   each test uses the creation methods differently but what is common here is that each test on the teadown() runs the cleanup
   https://github.com/nielsen-oss/incubator-superset/blob/60d2d91d10401f8e6f258c88339f2a1162a355a6/tests/dashboards/security/base_case.py#L27
   
   I don't see how it will be each to use that now, but combine that `db_insert_temp_object `  in the future pytest functional testing 
   also partially related to this discussion




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.27%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.27%   -1.28%     
   ==========================================
     Files        1018      488     -530     
     Lines       49787    30045   -19742     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19012   -13129     
   + Misses      17468    11033    -6435     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.27% <50.00%> (-0.86%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | ... and [561 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (0c11ffc) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `12.24%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   50.88%   -12.25%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17131    -32901     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     8717    -22870     
   + Misses      18245     8414     -9831     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.88% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
   | ... and [926 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...0c11ffc](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `0.96%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   65.51%   +0.96%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49921     +134     
     Branches     4971     4888      -83     
   ==========================================
   + Hits        32141    32708     +567     
   + Misses      17468    17061     -407     
   + Partials      178      152      -26     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `41.40% <ø> (+4.19%)` | :arrow_up: |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.63% <50.00%> (-0.50%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [...nents/controls/MetricControl/AdhocMetricOption.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljT3B0aW9uLmpzeA==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...rols/MetricControl/AdhocMetricEditPopoverTitle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljRWRpdFBvcG92ZXJUaXRsZS5qc3g=) | `70.58% <0.00%> (-20.59%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `82.60% <0.00%> (-8.09%)` | :arrow_down: |
   | ... and [101 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2b8cd8e) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.27%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.40%   +8.27%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19930   -30102     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14232   -17355     
   + Misses      18245     5574   -12671     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.89% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [superset/datasets/commands/refresh.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvcmVmcmVzaC5weQ==) | | |
   | ... and [669 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...90a32fd](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/migrations/versions/11ccdd12658_add_roles_relationship_to_dashboard.py
##########
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""add roles relationship to dashboard
+Revision ID: e11ccdd12658
+Revises: c878781977c6
+Create Date: 2021-01-14 19:12:43.406230
+"""
+# revision identifiers, used by Alembic.
+revision = "e11ccdd12658"
+down_revision = "c878781977c6"
+import sqlalchemy as sa
+from alembic import op
+
+
+def upgrade():
+    op.create_table(
+        "dashboard_roles",
+        sa.Column("id", sa.Integer(), nullable=False),
+        sa.Column("role_id", sa.Integer(), nullable=False),
+        sa.Column("dashboard_id", sa.Integer(), nullable=True),
+        sa.ForeignKeyConstraint(["dashboard_id"], ["dashboards.id"]),
+        sa.ForeignKeyConstraint(["role_id"], ["ab_role.id"]),
+        sa.PrimaryKeyConstraint("id"),
+    )
+
+    pass

Review comment:
       forgotten `pass` 




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.97%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   62.58%   -1.98%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49792       +5     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    31162     -979     
   - Misses      17468    18432     +964     
   - Partials      178      198      +20     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.66% <45.00%> (-0.47%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | ... and [98 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)

Review comment:
       how would the syntax look like can you provide an example?
   in order to re implment the method self.assertIn




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/migrations/versions/11ccdd12658_add_roles_relationship_to_dashboard.py
##########
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""add roles relationship to dashboard
+Revision ID: e11ccdd12658
+Revises: c878781977c6
+Create Date: 2021-01-14 19:12:43.406230
+"""
+# revision identifiers, used by Alembic.
+revision = "e11ccdd12658"
+down_revision = "c878781977c6"
+import sqlalchemy as sa
+from alembic import op
+
+
+def upgrade():
+    op.create_table(
+        "dashboard_roles",
+        sa.Column("id", sa.Integer(), nullable=False),
+        sa.Column("role_id", sa.Integer(), nullable=False),
+        sa.Column("dashboard_id", sa.Integer(), nullable=True),
+        sa.ForeignKeyConstraint(["dashboard_id"], ["dashboards.id"]),
+        sa.ForeignKeyConstraint(["role_id"], ["ab_role.id"]),
+        sa.PrimaryKeyConstraint("id"),
+    )
+
+    pass
+
+
+def downgrade():
+    op.drop_table("dashboard_roles")
+    pass

Review comment:
       Same here

##########
File path: superset/migrations/versions/11ccdd12658_add_roles_relationship_to_dashboard.py
##########
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""add roles relationship to dashboard
+Revision ID: e11ccdd12658
+Revises: c878781977c6
+Create Date: 2021-01-14 19:12:43.406230
+"""
+# revision identifiers, used by Alembic.
+revision = "e11ccdd12658"
+down_revision = "c878781977c6"
+import sqlalchemy as sa
+from alembic import op
+
+
+def upgrade():
+    op.create_table(
+        "dashboard_roles",
+        sa.Column("id", sa.Integer(), nullable=False),
+        sa.Column("role_id", sa.Integer(), nullable=False),
+        sa.Column("dashboard_id", sa.Integer(), nullable=True),
+        sa.ForeignKeyConstraint(["dashboard_id"], ["dashboards.id"]),
+        sa.ForeignKeyConstraint(["role_id"], ["ab_role.id"]),
+        sa.PrimaryKeyConstraint("id"),
+    )
+
+    pass

Review comment:
       I think Daniel was referring to the redundant `pass` on line 40 that can be deleted.




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (c560de8) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.30%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.86%   +2.30%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49811      +24     
     Branches     4971     5007      +36     
   ==========================================
   + Hits        32141    33307    +1166     
   + Misses      17468    16381    -1087     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `64.02% <45.00%> (-0.11%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.25% <0.00%> (-5.85%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.58% <0.00%> (-0.28%)` | :arrow_down: |
   | [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.31% <0.00%> (+0.16%)` | :arrow_up: |
   | [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `62.42% <0.00%> (+0.21%)` | :arrow_up: |
   | [.../explore/components/controls/DateFilterControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC5qc3g=) | `56.32% <0.00%> (+0.57%)` | :arrow_up: |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `81.88% <0.00%> (+0.78%)` | :arrow_up: |
   | ... and [129 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0b869a2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (594e9f2) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.83%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.97%   +3.83%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33610    +2023     
   + Misses      18245    16441    -1804     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.81% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.96% <60.86%> (-0.13%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.25% <0.00%> (-6.28%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [...hboard/components/nativeFilters/CascadePopover.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvQ2FzY2FkZVBvcG92ZXIudHN4) | `18.18% <0.00%> (-4.46%)` | :arrow_down: |
   | ... and [219 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...594e9f2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-770337622


   >  Screen.Recording.2021-01-30.at.10.41.59.PM.mov 
   > tested~ for some reason, getting "unexpected errors" on all charts in the dashboard from gamma account. is it something I did wrong? @amitmiran137
   
   thanks for checking this.
   this PR focuses on the backend filtering the list of dashboards by the access given to the user.
   if a user was given access to the Dashboard, that alone is not enough, and access to the relevant **dataset** still needs to be provided.
   having said that, we plan in a follow-up PR that user will be given temporary read access to all of the datasets within a dashboard as was mentioned in the development milestones in #10408 
   _allow token-based access to /explore_json and API/v1/chart/data to allow reading datasets only by have dashboard access for read-only purpose_


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (903e3ba) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.22%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.36%   +0.22%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30146   -19886     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19101   -12486     
   + Misses      18245    11045    -7200     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.36% <50.00%> (-0.74%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | ... and [566 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...903e3ba](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (60d2d91) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.55%`.
   > The diff coverage is `43.75%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.69%   +0.55%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30189   -19843     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19228   -12359     
   + Misses      18245    10961    -7284     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.69% <43.75%> (-0.41%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `89.78% <0.00%> (-2.09%)` | :arrow_down: |
   | ... and [552 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...60d2d91](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.48%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.61%   +3.48%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50207     +175     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33447    +1860     
   + Misses      18245    16636    -1609     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `63.38% <50.00%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | ... and [213 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ac45a58) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.13%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   62.99%   -0.14%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50150     +118     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    31594       +7     
   - Misses      18245    18341      +96     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.70% <60.86%> (-0.39%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | ... and [59 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...ac45a58](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765341484


   > Could you add a test plan and maybe some test cases?
   > 
   > I think we should at least test visiting the dashboards list page as each of the following:
   > 
   > 1. an anonymous user
   > 2. a non-admin (test user: alpha/general)
   > 3. admin
   
   I've added those to the test plan.
   I plan to start implementing the tests once we [vote](https://lists.apache.org/thread.html/r91c0acde742a9a719a30938d708e945890ade944ea476dc1def61975%40%3Cdev.superset.apache.org%3E) for the SIP is approved.
   can you vote please so we. can move forward with this in a non-POC approach?


----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)
+
+    def test_get_dashboards__user_can_not_view_unpublished_dash(self):
+        # arrange
+        admin_user = security_manager.find_user(ADMIN_USERNAME)
+        gamma_user = security_manager.find_user(GAMMA_USERNAME)
+        slug = f"admin_owned_unpublished_dash_{random_slug()}"
+
+        admin_and_not_published_dashboard = create_dashboard_to_db(
+            "My Dashboard", slug=slug, owners=[admin_user]
+        )
+
+        self.login(gamma_user.username)
+
+        # act - list dashboards as a gamma user
+        get_dashboards_response_as_gamma = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(
+            admin_and_not_published_dashboard.url, get_dashboards_response_as_gamma
+        )
+
+    @pytest.mark.usefixtures("load_energy_table_with_slice", "load_dashboard")
+    def test_get_dashboards__users_can_view_permitted_dashboard(self):
+        # arrange
+        username = random_str()
+        new_role = f"role_{random_str()}"
+        self.create_user_with_roles(username, [new_role], copy_roles=True)
+        accessed_table = get_sql_table_by_name("energy_usage")
+        self.grant_role_access_to_table(accessed_table, new_role)
+        # get a slice from the allowed table
+        slice_to_add_to_dashboards = get_slice_by_name("Energy Sankey")
+        # Create a published and hidden dashboard and add them to the database
+        first_dash = create_dashboard_to_db(
+            dashboard_title="Published Dashboard",
+            slug=f"first_dash_{random_slug()}",
+            published=True,
+            slices=[slice_to_add_to_dashboards],
+        )
+
+        second_dash = create_dashboard_to_db(
+            dashboard_title="Hidden Dashboard",
+            slug=f"second_dash_{random_slug()}",
+            published=True,
+            slices=[slice_to_add_to_dashboards],
+        )
+
+        try:
+            self.login(username)
+            # act
+            get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+            # assert
+            self.assertIn(second_dash.url, get_dashboards_response)
+            self.assertIn(first_dash.url, get_dashboards_response)
+        finally:
+            self.revoke_public_access_to_table(accessed_table)
+
+    @staticmethod
+    def __add_dashboard_mode_params(dashboard_url):

Review comment:
       Was this function used anywhere? I couldn't find it. And why was it defined in two places?




----------------------------------------------------------------
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-io edited a comment on pull request #12680: Feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (9d26d30) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `6.62%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   71.17%   +6.62%     
   ==========================================
     Files        1018      532     -486     
     Lines       49787    19808   -29979     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    14099   -18042     
   + Misses      17468     5586   -11882     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...s/versions/db0c65b146bd\_update\_slice\_model\_json.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9kYjBjNjViMTQ2YmRfdXBkYXRlX3NsaWNlX21vZGVsX2pzb24ucHk=) | | |
   | [...igrations/versions/c5756bec8b47\_time\_grain\_sqla.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9jNTc1NmJlYzhiNDdfdGltZV9ncmFpbl9zcWxhLnB5) | | |
   | [...ations/versions/f162a1dea4c4\_d3format\_by\_metric.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9mMTYyYTFkZWE0YzRfZDNmb3JtYXRfYnlfbWV0cmljLnB5) | | |
   | [superset/examples/utils.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvdXRpbHMucHk=) | | |
   | [...tions/versions/db527d8c4c78\_add\_db\_verbose\_name.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9kYjUyN2Q4YzRjNzhfYWRkX2RiX3ZlcmJvc2VfbmFtZS5weQ==) | | |
   | [superset/dashboards/commands/export.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9leHBvcnQucHk=) | | |
   | [...et/migrations/versions/12d55656cbca\_is\_featured.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMmQ1NTY1NmNiY2FfaXNfZmVhdHVyZWQucHk=) | | |
   | [superset/migrations/versions/705732c70154\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83MDU3MzJjNzAxNTRfLnB5) | | |
   | [superset/migrations/versions/8e80a26a31db\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy84ZTgwYTI2YTMxZGJfLnB5) | | |
   | [...40e8ea\_change\_table\_schema\_description\_to\_long\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy84OTExNWE0MGU4ZWFfY2hhbmdlX3RhYmxlX3NjaGVtYV9kZXNjcmlwdGlvbl90b19sb25nXy5weQ==) | | |
   | ... and [607 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...55199ed](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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] amitmiran137 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769007188


   I must add that I tried forcing the fixture approach here by trying to have a "create new user" fixture  for every test but it seems like I can't get the user created as an inject parameter to the test method bc we uses class based testing and not purely pytest in native syntax 
   The fixtures superset is using focus on the setup/teardown events but they don't provide a way to inject parameter to test methods 
   
   The tests here also uses the same approach of constructing and destructing objects with a have a dashboardTestUtils and base classes that provide all the common actions need to be done around the Dashboard domain
   
   The advantage of a utils that you can customize how you use it within each test instead of forcing working from a decorator only 
   
   The difference here that 


----------------------------------------------------------------
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] junlincc commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-770336289


   
   https://user-images.githubusercontent.com/67837651/106376689-7f56ee80-634c-11eb-8a03-553fe94149c5.mov
   
   tested~ for some reason, getting "unexpected errors" on all charts in the dashboard from gamma account. is it something I did wrong? @amitmiran137 


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (60d2d91) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.56%`.
   > The diff coverage is `43.75%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.70%   +0.56%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30174   -19858     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19221   -12366     
   + Misses      18245    10953    -7292     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.70% <43.75%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `89.78% <0.00%> (-2.09%)` | :arrow_down: |
   | ... and [558 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...60d2d91](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2b8cd8e) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.06%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.19%   +8.06%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19930   -30102     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14189   -17398     
   + Misses      18245     5613   -12632     
   + Partials      200      128      -72     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.51% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [...igrations/versions/763d4b211ec9\_fixing\_audit\_fk.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83NjNkNGIyMTFlYzlfZml4aW5nX2F1ZGl0X2ZrLnB5) | | |
   | ... and [668 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...90a32fd](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/views/dashboard/mixin.py
##########
@@ -62,6 +63,10 @@ class DashboardMixin:  # pylint: disable=too-few-public-methods
             "want to alter specific parameters."
         ),
         "owners": _("Owners is a list of users who can alter the dashboard."),
+        "roles": _(
+            "Roles is a list which defines access to the dashboard. if list is "
+            "empty access is managed by the data access level."

Review comment:
       Would be good to explain that these roles are always applied in addition to data access level, with the exception of no roles which makes the dashboard available to all roles.

##########
File path: tests/base_tests.py
##########
@@ -289,19 +294,39 @@ def get_access_requests(self, username, ds_type, ds_id):
     def logout(self):
         self.client.get("/logout/", follow_redirects=True)
 
+    def grant_access_to_dashboard(self, dashboard, role_name="Public"):
+        role = security_manager.find_role(role_name)
+        dashboard.roles.append(role)
+        db.session.merge(dashboard)
+        db.session.commit()
+
+    def revoke_access_to_dashboard(self, dashboard, role_name="Public"):

Review comment:
       same here

##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       General comment: we should preferably not be introducing new class-based tests, but rather use functional `pytest` based tests. Check `tests/alerts_tests.py` for an example. Given that this is so far along in the making this is probably fine, but if it's possible to convert to proper `pytest` that would be awesome.

##########
File path: tests/base_tests.py
##########
@@ -289,19 +294,39 @@ def get_access_requests(self, username, ds_type, ds_id):
     def logout(self):
         self.client.get("/logout/", follow_redirects=True)
 
+    def grant_access_to_dashboard(self, dashboard, role_name="Public"):

Review comment:
       Let's make `role_name` mandatory, using the default will cause confusion down the line.

##########
File path: tests/dashboard_tests.py
##########
@@ -453,24 +453,6 @@ def test_only_owners_can_save(self):
         db.session.commit()
         self.test_save_dash("alpha")
 
-    def test_owners_can_view_empty_dashboard(self):
-        dash = db.session.query(Dashboard).filter_by(slug="empty_dashboard").first()
-        if not dash:
-            dash = Dashboard()
-            dash.dashboard_title = "Empty Dashboard"
-            dash.slug = "empty_dashboard"
-        else:
-            dash.slices = []
-            dash.owners = []
-        db.session.merge(dash)
-        db.session.commit()
-
-        gamma_user = security_manager.find_user("gamma")
-        self.login(gamma_user.username)
-
-        resp = self.get_resp("/api/v1/dashboard/")
-        self.assertNotIn("/superset/dashboard/empty_dashboard/", resp)
-

Review comment:
       Why was this removed? Update: it seems this was moved to `tests/dashboards/security` - never mind




----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/base_tests.py
##########
@@ -289,19 +294,39 @@ def get_access_requests(self, username, ds_type, ds_id):
     def logout(self):
         self.client.get("/logout/", follow_redirects=True)
 
+    def grant_access_to_dashboard(self, dashboard, role_name):
+        role = security_manager.find_role(role_name)
+        dashboard.roles.append(role)
+        db.session.merge(dashboard)
+        db.session.commit()

Review comment:
       These class methods can probably be moved to standalone functions somewhere since they don't rely on `self`.




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)

Review comment:
       they are being deleted in teardown together with the rest of the objects created (like tables and slices)




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.05%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.61%   +2.05%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49921     +134     
     Branches     4971     4888      -83     
   ==========================================
   + Hits        32141    33255    +1114     
   + Misses      17468    16541     -927     
   + Partials      178      125      -53     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.63% <50.00%> (-0.50%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `82.60% <0.00%> (-8.09%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [...frontend/src/dashboard/containers/FiltersBadge.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0ZpbHRlcnNCYWRnZS50c3g=) | `89.28% <0.00%> (-3.31%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | ... and [142 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-766548269


   > can you vote please so we can move forward with this in a non-POC approach?
   
   Just saw it has passed. :D  Didn't notice you've updated the SIP summary. Thanks for iterating on your proposal and creating this POC!
   
   @dpgaspar's diagram makes perfect sense to me. Looks like things can be even simpler than I original thought. Maybe include the diagram in the SIP as a reference, too?


----------------------------------------------------------------
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] dpgaspar edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
dpgaspar edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765383546


   I like this approach, IMO we should move to include database, datasets and charts to this pattern also. I personally would like to deprecate string based permissions constructed based on the dataset.name and dataset.id for example.
   
   ![Blank diagram (6)](https://user-images.githubusercontent.com/4025227/105494222-6302e400-5cb2-11eb-8f0d-6a609d73cc6c.png)
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `2.60%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   65.74%   +2.60%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50185     +153     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    32992    +1405     
   + Misses      18245    17039    -1206     
   + Partials      200      154      -46     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `44.69% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [173 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.99%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   62.56%   -2.00%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49792       +5     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    31151     -990     
   - Misses      17468    18443     +975     
   - Partials      178      198      +20     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.62% <45.00%> (-0.51%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | ... and [101 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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] amitmiran137 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769007188


   I must add that I tried forcing the fixture approach here by trying to have a "create new user" fixture  for every test but it seems like I can't get the user created as an inject parameter to the test method bc we uses class based testing and not purely pytest in native syntax 
   The fixtures superset is using focus on the setup/teardown events but they don't provide a way to inject parameter to test methods 
   
   The tests here also uses the same approach of constructing and destructing objects with a have a dashboardTestUtils and base classes that provide all the common actions need to be done around the Dashboard domain
   
   The advantage of a utils that you can customize how you use it within each test instead of forcing working from a decorator only 
   
   I hope you like it
   🤞


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (00c97cb) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.09%`.
   > The diff coverage is `52.63%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.65%   +2.09%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49809      +22     
     Branches     4971     4877      -94     
   ==========================================
   + Hits        32141    33200    +1059     
   + Misses      17468    16486     -982     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.66% <52.63%> (-0.47%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `60.02% <100.00%> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.04% <0.00%> (-0.82%)` | :arrow_down: |
   | ... and [133 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0223844](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2c2ade8) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.19%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   62.93%   -0.20%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50097      +65     
     Branches     4915     5191     +276     
   ==========================================
   - Hits        31587    31528      -59     
   - Misses      18245    18358     +113     
   - Partials      200      211      +11     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.73% <ø> (+0.05%)` | :arrow_up: |
   | python | `63.72% <50.00%> (-0.37%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | [...ntrols/MetricControl/AdhocMetricPopoverTrigger.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljUG9wb3ZlclRyaWdnZXIudHN4) | `68.42% <0.00%> (-6.58%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | ... and [24 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2c2ade8](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2c2ade8) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.55%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.69%   +0.55%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30158   -19874     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19208   -12379     
   + Misses      18245    10950    -7295     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.69% <50.00%> (-0.41%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `89.79% <0.00%> (-2.05%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | ... and [544 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2c2ade8](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.24%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.30%   -1.25%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    29988   -19799     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    18985   -13156     
   + Misses      17468    11003    -6465     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.30% <45.00%> (-0.83%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | ... and [556 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)

Review comment:
       I saw that, and thought I had actually deleted this comment :P nevermind 




----------------------------------------------------------------
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-io edited a comment on pull request #12680: Feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (55199ed) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `3.60%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   60.94%   -3.61%     
   ==========================================
     Files        1018      532     -486     
     Lines       49787    19789   -29998     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    12061   -20080     
   + Misses      17468     7530    -9938     
   - Partials      178      198      +20     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-77.78%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupFormatters.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy50cw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [...c/visualizations/FilterBox/FilterBoxChartPlugin.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9GaWx0ZXJCb3hDaGFydFBsdWdpbi5qcw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [...c/visualizations/TimeTable/TimeTableChartPlugin.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL1RpbWVUYWJsZS9UaW1lVGFibGVDaGFydFBsdWdpbi5qcw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | ... and [573 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...55199ed](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.05%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.19%   +4.05%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33921    +2334     
   + Misses      18245    16438    -1807     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.36% <50.00%> (+0.27%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `96.42% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/result\_set.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.69% <0.00%> (-1.66%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | ... and [201 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `0.95%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.60%   -0.96%     
   ==========================================
     Files        1018      488     -530     
     Lines       49787    30045   -19742     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19110   -13031     
   + Misses      17468    10935    -6533     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.60% <50.00%> (-0.53%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `89.79% <0.00%> (-2.05%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `87.22% <0.00%> (-1.64%)` | :arrow_down: |
   | ... and [546 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769872885


   > > Also just an heads up that this implementation will need some follow up work so that the new REACT/CRUD views include the `roles` field also, @benceorlai.
   > 
   > Already agreed about a design with @mihir174 and will implement on followup PR
   
   Awesome!


----------------------------------------------------------------
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] dpgaspar commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769861922


   Also just an heads up that this implementation will need some follow up work so that the new REACT/CRUD views include the `roles` field also, @benceorlai.


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2826b77) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.62%`.
   > The diff coverage is `47.05%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.75%   +3.62%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50160     +128     
     Branches     4915     5198     +283     
   ==========================================
   + Hits        31587    33484    +1897     
   + Misses      18245    16537    -1708     
   + Partials      200      139      -61     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.47% <ø> (?)` | |
   | javascript | `61.99% <ø> (+0.31%)` | :arrow_up: |
   | python | `63.69% <47.05%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [220 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2826b77](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: Feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (9d26d30) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `4.57%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   69.12%   +4.57%     
   ==========================================
     Files        1018      532     -486     
     Lines       49787    19807   -29980     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    13692   -18449     
   + Misses      17468     5976   -11492     
   + Partials      178      139      -39     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `47.75% <ø> (+10.54%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-59.26%)` | :arrow_down: |
   | [superset-frontend/src/SqlLab/index.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9pbmRleC50c3g=) | `0.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/TabbedSqlEditors.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMuanN4) | `72.78% <0.00%> (-8.87%)` | :arrow_down: |
   | [superset-frontend/src/reduxUtils.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3JlZHV4VXRpbHMudHM=) | `69.62% <0.00%> (-8.87%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `72.44% <0.00%> (-8.67%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/SqlEditorLeftBar.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIuanN4) | `45.09% <0.00%> (-7.85%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/QueryAutoRefresh.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1F1ZXJ5QXV0b1JlZnJlc2guanN4) | `65.90% <0.00%> (-6.82%)` | :arrow_down: |
   | [...erset-frontend/src/components/DatabaseSelector.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRGF0YWJhc2VTZWxlY3Rvci50c3g=) | `84.04% <0.00%> (-6.39%)` | :arrow_down: |
   | [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `50.00% <0.00%> (-4.77%)` | :arrow_down: |
   | ... and [588 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...55199ed](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.07%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.20%   +4.07%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33929    +2342     
   + Misses      18245    16430    -1815     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.39% <50.00%> (+0.29%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2b8cd8e) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `1.43%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   61.69%   -1.44%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19911   -30121     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    12284   -19303     
   + Misses      18245     7427   -10818     
     Partials      200      200              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `47.00% <0.00%> (-0.02%)` | :arrow_down: |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [...sions/1f6dca87d1a2\_security\_converge\_dashboards.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xZjZkY2E4N2QxYTJfc2VjdXJpdHlfY29udmVyZ2VfZGFzaGJvYXJkcy5weQ==) | | |
   | [...ons/b4456560d4f3\_change\_table\_unique\_constraint.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9iNDQ1NjU2MGQ0ZjNfY2hhbmdlX3RhYmxlX3VuaXF1ZV9jb25zdHJhaW50LnB5) | | |
   | [...ab3d66c4246e\_add\_cache\_timeout\_to\_druid\_cluster.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9hYjNkNjZjNDI0NmVfYWRkX2NhY2hlX3RpbWVvdXRfdG9fZHJ1aWRfY2x1c3Rlci5weQ==) | | |
   | [...rations/versions/7dbf98566af7\_slice\_description.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83ZGJmOTg1NjZhZjdfc2xpY2VfZGVzY3JpcHRpb24ucHk=) | | |
   | [...rations/versions/c82ee8a39623\_add\_implicit\_tags.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9jODJlZThhMzk2MjNfYWRkX2ltcGxpY2l0X3RhZ3MucHk=) | | |
   | [superset/migrations/versions/ef8843b41dac\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy9lZjg4NDNiNDFkYWNfLnB5) | | |
   | [...erset/queries/saved\_queries/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcXVlcmllcy9zYXZlZF9xdWVyaWVzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | | |
   | [superset/reports/commands/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9iYXNlLnB5) | | |
   | ... and [479 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...90a32fd](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (90a32fd) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `16.83%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   46.29%   -16.84%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17129    -32903     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     7930    -23657     
   + Misses      18245     9199     -9046     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `46.29% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...tend/src/dashboard/util/getDirectPathToTabIndex.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERpcmVjdFBhdGhUb1RhYkluZGV4Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...erset-frontend/src/common/hooks/useChangeEffect.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9ob29rcy91c2VDaGFuZ2VFZmZlY3QudHM=) | `0.00% <0.00%> (-87.50%)` | :arrow_down: |
   | [...d/src/dashboard/util/updateComponentParentsList.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL3VwZGF0ZUNvbXBvbmVudFBhcmVudHNMaXN0Lmpz) | `0.00% <0.00%> (-87.50%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | ... and [929 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...e7a4770](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       > after deep diving in the differences between alerts and dashboards tests I noticed that alerts are being tested more like unit tests and dashboard security needs to be tests like integration tests.
   > to fully test we need the ability to tests against the http layer and to perform common actions like login and and other http calls which will need many abilities that comes out of the box in **SupersetTestCase**
   > we will need to add test utils for functionall pytest in order support what currently exists. on class based test
   
   Fair enough, and you may well be correct in that this will require a fair bit of new plumbing in the test utils before we can fully deprecate `SupersetTestCase`. I'm ok with keeping the current structure so we don't block this feature due to pending test pattern refactoring.




----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/base_tests.py
##########
@@ -149,7 +150,11 @@ def create_user_with_roles(username: str, roles: List[str]):
             db.session.commit()
             user_to_create = security_manager.find_user(username)
             assert user_to_create
-        user_to_create.roles = [security_manager.find_role(r) for r in roles]
+        user_to_create.roles = []
+        for chosen_user_role in roles:
+            if copy_roles:
+                security_manager.copy_role("Gamma", chosen_user_role, False)

Review comment:
       The name `copy_roles` is a little confusing considering you are just copying `Gamma` permissions over to the new roles. Considering multiple roles can be added to a user, what you want is probably something like this:
   
   ```python
       def create_user_with_roles(
           username: str, roles: List[str], include_gamma_role: bool = True
       ):
             ...
             user_to_create.roles = (
                 [security_manager.find_role("Gamma")]
                 if include_gamma_role else []
             ) + [security_manager.find_role(r) for r in roles]
   ```




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `1.08%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   65.64%   +1.08%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49811      +24     
     Branches     4971     4877      -94     
   ==========================================
   + Hits        32141    32697     +556     
   + Misses      17468    16976     -492     
   + Partials      178      138      -40     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `45.54% <ø> (+8.33%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `63.66% <45.00%> (-0.47%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [.../controls/MetricControl/AdhocMetricEditPopover.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljRWRpdFBvcG92ZXIuanN4) | `53.17% <0.00%> (-25.40%)` | :arrow_down: |
   | [...nents/controls/MetricControl/AdhocMetricOption.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljT3B0aW9uLmpzeA==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...rols/MetricControl/AdhocMetricEditPopoverTitle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljRWRpdFBvcG92ZXJUaXRsZS5qc3g=) | `70.58% <0.00%> (-20.59%)` | :arrow_down: |
   | [...-frontend/src/explore/components/ControlHeader.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sSGVhZGVyLmpzeA==) | `66.66% <0.00%> (-18.52%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   | ... and [117 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       after deep diving in the differences between alerts and dashboards tests I noticed that alerts are being tested more like unit tests and dashboard security needs to be tests like integration tests.
   to fully test we need the ability to tests against the http layer and to perform common actions like login and and other http calls which will need many abilities that comes out of the box in **SupersetTestCase** 
   we will need to add test utils for functionall pytest in order support what currently exists. on class based test
   




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.56%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.69%   +0.56%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30195   -19837     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19234   -12353     
   + Misses      18245    10961    -7284     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.69% <60.86%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [553 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] villebro commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -107,8 +121,11 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datasource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query)
+                if is_feature_enabled("DASHBOARD_RBAC")
+                else None,

Review comment:
       Here we could do the same i.e.
   ```python
   dashboard_rbac_or_filters = []
   if is_feature_enabled("DASHBOARD_RBAC"):
       dashboard_rbac_or_filters.append(Dashboard.id.in_(roles_based_query))
   ```
   , and then unpack that in a similar fashion:
   ```python
               or_(
                   Dashboard.id.in_(owner_ids_query),
                   Dashboard.id.in_(datasource_perm_query),
                   Dashboard.id.in_(users_favorite_dash_query),
                   *dashboard_rbac_or_filters,
   ```

##########
File path: superset/dashboards/filters.py
##########
@@ -74,12 +75,14 @@ def apply(self, query: Query, value: Any) -> Query:
 
         datasource_perms = security_manager.user_view_menu_names("datasource_access")
         schema_perms = security_manager.user_view_menu_names("schema_access")
-        published_dash_query = (
+        dashboard_has_roles = Dashboard.roles.any()
+        datasource_perm_query = (
             db.session.query(Dashboard.id)
             .join(Dashboard.slices)
             .filter(
                 and_(
-                    Dashboard.published == True,  # pylint: disable=singleton-comparison
+                    Dashboard.published.is_(True),
+                    ~dashboard_has_roles,

Review comment:
       This addition doesn't take into consideration the FF. Could we do something like this?
   ```python
   dashboard_rbac_and_filters = []
   if is_feature_enabled("DASHBOARD_RBAC"):
       dashboard_rbac_and_filters.append(~dashboard_has_roles)
   ```
   and then later
   ```python
           datasource_perm_query = (
               db.session.query(Dashboard.id)
               .join(Dashboard.slices)
               .filter(
                   and_(
                       Dashboard.published.is_(True),
                       *dashboard_rbac_and_filters,
   ```
   This way the logic would be fully unchanged when the FF is disabled and the additional `AND` only added when turned on.




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `2.00%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   62.55%   -2.01%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49902     +115     
     Branches     4971     4888      -83     
   ==========================================
   - Hits        32141    31215     -926     
   - Misses      17468    18487    +1019     
   - Partials      178      200      +22     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.63% <50.00%> (-0.50%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | ... and [112 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.27%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.82%   +2.27%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49921     +134     
     Branches     4971     4888      -83     
   ==========================================
   + Hits        32141    33362    +1221     
   + Misses      17468    16434    -1034     
   + Partials      178      125      -53     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.98% <50.00%> (-0.15%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `82.60% <0.00%> (-8.09%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.25% <0.00%> (-5.85%)` | :arrow_down: |
   | [...frontend/src/dashboard/containers/FiltersBadge.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0ZpbHRlcnNCYWRnZS50c3g=) | `89.28% <0.00%> (-3.31%)` | :arrow_down: |
   | [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `88.88% <0.00%> (-1.59%)` | :arrow_down: |
   | [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `51.33% <0.00%> (-1.15%)` | :arrow_down: |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `59.06% <0.00%> (-0.97%)` | :arrow_down: |
   | ... and [139 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769611063


   > This is amazing! Thank you so much for the comprehensive test cases.
   > 
   > It seems this PR did not apply RBAC restriction on [the Dashboard page](https://github.com/apache/superset/blob/55c8f9ba600b1de4f8ed08db6a5ff7ab2d33924f/superset/views/core.py#L1783), will it be in a separate PR?
   
   Thank you @ktmud 
   Up until now there were now restrictions at all on the dashboard page and it is accessible with some basic permissions
   So yes, Follow up PR will enforce the same standard just for a single dashboard


----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -107,9 +119,14 @@ def apply(self, query: Query, value: Any) -> Query:
         query = query.filter(
             or_(
                 Dashboard.id.in_(owner_ids_query),
-                Dashboard.id.in_(published_dash_query),
+                Dashboard.id.in_(datesource_perm_query),
                 Dashboard.id.in_(users_favorite_dash_query),
+                Dashboard.id.in_(roles_based_query),
             )
         )
 
         return query
+
+    @staticmethod
+    def has_no_role_based_access() -> bool:

Review comment:
       nit: we should avoid negation in naming, to [avoid future double negatives](https://www.gymglish.com/en/gymglish/english-grammar/avoiding-double-negative-constructions), i.e.
   
   ```
   not self.has_role_based_access()
   self.has_role_based_access()
   ```
   
   Reads nicer than
   
   ```
   self.has_no_role_based_access()
   not self.has_no_role_based_access()
   ```




----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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] dpgaspar edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
dpgaspar edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765383546


   I like this approach, IMO we should move to include database, datasets and charts to this pattern also. I personally would like to deprecate string based permissions constructed based on the dataset.name and dataset.id for example.
   
   Recalling a diagram
   ![Blank diagram (6)](https://user-images.githubusercontent.com/4025227/105494222-6302e400-5cb2-11eb-8f0d-6a609d73cc6c.png)
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2826b77) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.70%`.
   > The diff coverage is `47.05%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.84%   +3.70%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50160     +128     
     Branches     4915     5198     +283     
   ==========================================
   + Hits        31587    33527    +1940     
   + Misses      18245    16498    -1747     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.84% <ø> (?)` | |
   | javascript | `61.99% <ø> (+0.31%)` | :arrow_up: |
   | python | `63.69% <47.05%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [221 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2826b77](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       Could you shed light on what's the benefit of testing favorited dashboards separately? Do we expect a risk that favorites somehow wouldn't be accessible?




----------------------------------------------------------------
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] villebro merged pull request #12680: feat(dashboard-rbac): dashboard lists

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


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `5.43%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   59.12%   -5.44%     
   ==========================================
     Files        1018      964      -54     
     Lines       49787    47130    -2657     
     Branches     4971     4396     -575     
   ==========================================
   - Hits        32141    27864    -4277     
   - Misses      17468    19266    +1798     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `63.78% <50.00%> (-0.35%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | ... and [455 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.07%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.20%   +4.07%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33929    +2342     
   + Misses      18245    16430    -1815     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.39% <50.00%> (+0.29%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ac45a58) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.11%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   63.01%   -0.12%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50165     +133     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    31613      +26     
   - Misses      18245    18337      +92     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [51 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...ac45a58](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (7036216) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `12.62%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   50.51%   -12.63%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17129    -32903     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     8652    -22935     
   + Misses      18245     8477     -9768     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.51% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
   | ... and [926 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...7036216](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **increase** coverage by `2.30%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   64.55%   66.86%   +2.30%     
   ==========================================
     Files        1018     1019       +1     
     Lines       49787    49811      +24     
     Branches     4971     4877      -94     
   ==========================================
   + Hits        32141    33307    +1166     
   + Misses      17468    16381    -1087     
   + Partials      178      123      -55     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.96% <ø> (+13.75%)` | :arrow_up: |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `64.02% <45.00%> (-0.11%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.25% <0.00%> (-5.85%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.58% <0.00%> (-0.28%)` | :arrow_down: |
   | [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.31% <0.00%> (+0.16%)` | :arrow_up: |
   | [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `62.42% <0.00%> (+0.21%)` | :arrow_up: |
   | [.../explore/components/controls/DateFilterControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC5qc3g=) | `56.32% <0.00%> (+0.57%)` | :arrow_up: |
   | [...perset-frontend/src/views/CRUD/chart/ChartList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvY2hhcnQvQ2hhcnRMaXN0LnRzeA==) | `81.88% <0.00%> (+0.78%)` | :arrow_up: |
   | ... and [129 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.11%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   63.01%   -0.12%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50165     +133     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    31613      +26     
   - Misses      18245    18337      +92     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [51 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `5.68%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   58.87%   -5.69%     
   ==========================================
     Files        1018      964      -54     
     Lines       49787    47115    -2672     
     Branches     4971     4396     -575     
   ==========================================
   - Hits        32141    27737    -4404     
   - Misses      17468    19378    +1910     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.90% <ø> (+13.70%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `63.39% <50.00%> (-0.74%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | ... and [466 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.18%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.31%   +4.18%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50991     +959     
     Branches     4915     4966      +51     
   ==========================================
   + Hits        31587    34325    +2738     
   + Misses      18245    16541    -1704     
   + Partials      200      125      -75     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.75% <ø> (+0.07%)` | :arrow_up: |
   | python | `64.59% <50.00%> (+0.50%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #12680: Feat: dashboard access roles

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



##########
File path: superset/dashboards/filters.py
##########
@@ -88,6 +90,11 @@ def apply(self, query: Query, value: Any) -> Query:
                 )
             )
         )
+        roles_based_query = (
+            db.session.query(Dashboard.id)
+            .join(Dashboard.roles)
+            .filter(and_(Dashboard.published.is_(True), Role.id.in_(get_user_roles())),)

Review comment:
       I think `get_user_roles()` will return `Role` object instead of role ids.
   
   ```suggestion
               .filter(
                   and_(
                       Dashboard.published.is_(True),
                       Role.id.in_([x.id for x in get_user_roles()]),
                   ),
               )
   ```

##########
File path: superset/dashboards/filters.py
##########
@@ -74,12 +75,13 @@ def apply(self, query: Query, value: Any) -> Query:
 
         datasource_perms = security_manager.user_view_menu_names("datasource_access")
         schema_perms = security_manager.user_view_menu_names("schema_access")
-        published_dash_query = (
+        datesource_perm_query = (
             db.session.query(Dashboard.id)
             .join(Dashboard.slices)
             .filter(
                 and_(
-                    Dashboard.published == True,  # pylint: disable=singleton-comparison
+                    Dashboard.published.is_(True),
+                    ~Dashboard.roles.any(),

Review comment:
       This line is a little obscure. Maybe add a comment explaining what it does?
   
   ```suggestion
                       # has no role-based access specified
                       ~Dashboard.roles.any(),
   ```




----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (dcc8e66) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.14%`.
   > The diff coverage is `35.29%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.41%   -1.15%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    29998   -19789     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19022   -13119     
   + Misses      17468    10976    -6492     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.41% <35.29%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.14% <100.00%> (+0.17%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.50% <0.00%> (-25.07%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/sql\_validators/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvYmFzZS5weQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `79.59% <0.00%> (-6.38%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | ... and [548 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...c560de8](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (27f8fb9) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `0.92%`.
   > The diff coverage is `45.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.63%   -0.93%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    29988   -19799     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19083   -13058     
   + Misses      17468    10905    -6563     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.63% <45.00%> (-0.50%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.24%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `89.79% <0.00%> (-2.05%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `87.22% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/reports/notifications/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL2Jhc2UucHk=) | `95.00% <0.00%> (-0.46%)` | :arrow_down: |
   | ... and [541 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...27f8fb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (903e3ba) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `4.30%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   58.83%   -4.31%     
   ==========================================
     Files        1022      965      -57     
     Lines       50032    47294    -2738     
     Branches     4915     4436     -479     
   ==========================================
   - Hits        31587    27824    -3763     
   - Misses      18245    19470    +1225     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.86% <ø> (?)` | |
   | javascript | `?` | |
   | python | `63.36% <50.00%> (-0.74%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | ... and [484 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...903e3ba](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       actually for a reason which is unclear to me access to fav dashboards is managed just by just have the fav dashboard even without any data/role access
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L106
   is it a mistake? 
   
   I also see here the filters just favs  are not being based on access control
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L48




----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/base_case.py
##########
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import json
+from typing import Any, Dict, Union
+
+import prison
+from flask import Response
+
+from superset import app, security_manager
+from tests.base_tests import SupersetTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import build_save_dash_parts
+from tests.dashboards.superset_factory_util import delete_all_inserted_objects
+
+
+class DashboardTestCase(SupersetTestCase):

Review comment:
       I've looked into alerts_tests.py 
   I understand its usefulles use by parameterizing the scenarios and I like it.
   but, it seems to be using 
   https://docs.pytest.org/en/stable/yieldfixture.html
   which seems to be deprecated
   is it still the right way to go?




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (b4d2cbb) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `8.04%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   71.17%   +8.04%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19932   -30100     
     Branches     4915     4914       -1     
   ==========================================
   - Hits        31587    14187   -17400     
   + Misses      18245     5617   -12628     
   + Partials      200      128      -72     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.50% <ø> (?)` | |
   | javascript | `61.68% <ø> (+<0.01%)` | :arrow_up: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `66.35% <0.00%> (-0.32%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.76% <0.00%> (-0.25%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [.../explore/components/controls/DatasourceControl.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC5qc3g=) | `62.68% <0.00%> (ø)` | |
   | [...rations/versions/7dbf98566af7\_slice\_description.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83ZGJmOTg1NjZhZjdfc2xpY2VfZGVzY3JpcHRpb24ucHk=) | | |
   | ... and [667 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...906fb50](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (0c11ffc) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `12.62%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   50.51%   -12.63%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17131    -32901     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     8653    -22934     
   + Misses      18245     8478     -9767     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.51% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
   | ... and [926 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...0c11ffc](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (cae1556) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.24%`.
   > The diff coverage is `47.05%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.37%   +0.24%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30187   -19845     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19132   -12455     
   + Misses      18245    11055    -7190     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.37% <47.05%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.50% <0.00%> (-25.07%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | ... and [563 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2826b77](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.24%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.38%   +0.24%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30180   -19852     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19129   -12458     
   + Misses      18245    11051    -7194     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.38% <60.86%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | ... and [571 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (58b680b) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `17.39%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   64.55%   47.15%   -17.40%     
   ===========================================
     Files        1018      476      -542     
     Lines       49787    17070    -32717     
     Branches     4971     4396      -575     
   ===========================================
   - Hits        32141     8050    -24091     
   + Misses      17468     9020     -8448     
   + Partials      178        0      -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `47.15% <ø> (+9.95%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...d/src/dashboard/util/updateComponentParentsList.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL3VwZGF0ZUNvbXBvbmVudFBhcmVudHNMaXN0Lmpz) | `0.00% <0.00%> (-87.50%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...end/src/SqlLab/components/ExploreResultsButton.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0V4cGxvcmVSZXN1bHRzQnV0dG9uLmpzeA==) | `8.00% <0.00%> (-84.00%)` | :arrow_down: |
   | ... and [910 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...58b680b](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (aa2e53e) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `2.02%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   62.53%   -2.03%     
   ==========================================
     Files        1018     1021       +3     
     Lines       49787    49887     +100     
     Branches     4971     4888      -83     
   ==========================================
   - Hits        32141    31197     -944     
   - Misses      17468    18490    +1022     
   - Partials      178      200      +22     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.91% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.60% <50.00%> (-0.53%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | ... and [122 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...aa2e53e](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.07%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.20%   +4.07%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33929    +2342     
   + Misses      18245    16430    -1815     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.39% <50.00%> (+0.29%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | ... and [196 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `4.07%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.20%   +4.07%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33928    +2341     
   + Misses      18245    16431    -1814     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.38% <50.00%> (+0.29%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | ... and [197 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 closed pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 closed pull request #12680:
URL: https://github.com/apache/superset/pull/12680


   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (14a7d74) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.89%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   67.03%   +3.89%     
   ==========================================
     Files        1022     1023       +1     
     Lines       50032    50483     +451     
     Branches     4915     4962      +47     
   ==========================================
   + Hits        31587    33840    +2253     
   + Misses      18245    16519    -1726     
   + Partials      200      124      -76     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `51.17% <ø> (?)` | |
   | javascript | `61.69% <ø> (+0.01%)` | :arrow_up: |
   | python | `64.09% <50.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `96.42% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `89.79% <0.00%> (-2.05%)` | :arrow_down: |
   | ... and [205 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...14a7d74](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (594e9f2) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.68%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.81%   +3.68%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33532    +1945     
   + Misses      18245    16519    -1726     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.81% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.70% <60.86%> (-0.39%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [222 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...594e9f2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io commented on pull request #12680: Feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (9d26d30) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `3.60%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   60.94%   -3.61%     
   ==========================================
     Files        1018      532     -486     
     Lines       49787    19789   -29998     
     Branches     4971     4877      -94     
   ==========================================
   - Hits        32141    12061   -20080     
   + Misses      17468     7530    -9938     
   - Partials      178      198      +20     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `60.94% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/filters/components/Select/types.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvdHlwZXMudHM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-93.34%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-77.78%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupFormatters.ts](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy50cw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [...c/visualizations/FilterBox/FilterBoxChartPlugin.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9GaWx0ZXJCb3hDaGFydFBsdWdpbi5qcw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [...c/visualizations/TimeTable/TimeTableChartPlugin.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL1RpbWVUYWJsZS9UaW1lVGFibGVDaGFydFBsdWdpbi5qcw==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | ... and [573 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...9d26d30](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (60e92a3) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `12.26%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   50.87%   -12.27%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17133    -32899     
     Branches     4915     4422      -493     
   ===========================================
   - Hits        31587     8716    -22871     
   + Misses      18245     8417     -9828     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.87% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
   | ... and [926 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...c8fadb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ac45a58) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.57%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.70%   +0.57%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30180   -19852     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19226   -12361     
   + Misses      18245    10954    -7291     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.70% <60.86%> (-0.39%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | ... and [560 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...ac45a58](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (7036216) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `12.24%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #12680       +/-   ##
   ===========================================
   - Coverage   63.13%   50.88%   -12.25%     
   ===========================================
     Files        1022      477      -545     
     Lines       50032    17129    -32903     
     Branches     4915     4421      -494     
   ===========================================
   - Hits        31587     8716    -22871     
   + Misses      18245     8413     -9832     
   + Partials      200        0      -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.88% <ø> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/nativeFilters/ScopingTree.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvU2NvcGluZ1RyZWUudHN4) | `6.25% <0.00%> (-93.75%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
   | ... and [926 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...7036216](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `3.70%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   66.83%   +3.70%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50186     +154     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    33542    +1955     
   + Misses      18245    16509    -1736     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.82% <ø> (?)` | |
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [220 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/superset_factory_util.py
##########
@@ -0,0 +1,303 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import logging
+from typing import Any, Callable, List, Optional
+
+from flask_appbuilder import Model
+from flask_appbuilder.security.sqla.models import User
+
+from superset import appbuilder
+from superset.connectors.sqla.models import SqlaTable, sqlatable_user
+from superset.models.core import Database
+from superset.models.dashboard import (
+    Dashboard,
+    dashboard_slices,
+    dashboard_user,
+    DashboardRoles,
+)
+from superset.models.slice import Slice, slice_user
+from tests.dashboards.dashboard_test_utils import random_slug, random_str, random_title
+
+logger = logging.getLogger(__name__)
+
+session = appbuilder.get_session
+
+inserted_dashboards_ids = []
+inserted_databases_ids = []
+inserted_sqltables_ids = []
+inserted_slices_ids = []

Review comment:
       the factory Util enables each test to use the different creation methods for dashboards, tables, slices and etc'.
   each test uses the creation methods differently but what is common here is that each test on the teadown() runs the cleanup
   https://github.com/nielsen-oss/incubator-superset/blob/60d2d91d10401f8e6f258c88339f2a1162a355a6/tests/dashboards/security/base_case.py#L27
   
   I don't see how it will be each to use that now, but combine that `db_insert_temp_object `  in the future pytest functional testing 
   also partially related to this [discussion](https://github.com/apache/superset/pull/12680#discussion_r566120529) 




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (594e9f2) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.13%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   63.00%   -0.14%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50165     +133     
     Branches     4915     5204     +289     
   ==========================================
   + Hits        31587    31604      +17     
   - Misses      18245    18346     +101     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.93% <ø> (+0.25%)` | :arrow_up: |
   | python | `63.70% <60.86%> (-0.39%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [53 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...594e9f2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (594e9f2) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.57%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.70%   +0.57%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30195   -19837     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19236   -12351     
   + Misses      18245    10959    -7286     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.70% <60.86%> (-0.39%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [554 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...594e9f2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
amitmiran137 edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-769611063


   > This is amazing! Thank you so much for the comprehensive test cases.
   > 
   > It seems this PR did not apply RBAC restriction on [the Dashboard page](https://github.com/apache/superset/blob/55c8f9ba600b1de4f8ed08db6a5ff7ab2d33924f/superset/views/core.py#L1783), will it be in a separate PR?
   
   Thank you @ktmud 
   Up until now there were no restrictions at all on the dashboard page and it is accessible with some basic permissions
   So yes, Follow up PR will enforce the same standard just for a single dashboard


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (0223844) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.12%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.42%   -1.13%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    29986   -19801     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19020   -13121     
   + Misses      17468    10966    -6502     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.42% <50.00%> (-0.70%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.69% <0.00%> (-24.88%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/sql\_validators/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvYmFzZS5weQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `79.59% <0.00%> (-6.38%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | ... and [554 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0223844](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ff92508) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `6.32%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   69.45%   +6.32%     
   ==========================================
     Files        1022      534     -488     
     Lines       50032    19933   -30099     
     Branches     4915     4915              
   ==========================================
   - Hits        31587    13845   -17742     
   + Misses      18245     5953   -12292     
   + Partials      200      135      -65     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `48.97% <ø> (?)` | |
   | javascript | `61.68% <ø> (ø)` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...frontend/src/components/SupersetResourceSelect.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU3VwZXJzZXRSZXNvdXJjZVNlbGVjdC50c3g=) | `67.74% <0.00%> (-2.26%)` | :arrow_down: |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | `84.14% <0.00%> (-1.04%)` | :arrow_down: |
   | [...ews/CRUD/annotationlayers/AnnotationLayerModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbmxheWVycy9Bbm5vdGF0aW9uTGF5ZXJNb2RhbC50c3g=) | `74.71% <0.00%> (-0.87%)` | :arrow_down: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `76.08% <0.00%> (-0.84%)` | :arrow_down: |
   | [...t-frontend/src/views/CRUD/welcome/SavedQueries.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9TYXZlZFF1ZXJpZXMudHN4) | `62.50% <0.00%> (-0.66%)` | :arrow_down: |
   | [...tend/src/views/CRUD/annotation/AnnotationModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTW9kYWwudHN4) | `66.14% <0.00%> (-0.53%)` | :arrow_down: |
   | [...frontend/src/views/CRUD/alert/AlertReportModal.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvQWxlcnRSZXBvcnRNb2RhbC50c3g=) | `46.78% <0.00%> (-0.24%)` | :arrow_down: |
   | [.../src/components/dataViewCommon/TableCollection.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvZGF0YVZpZXdDb21tb24vVGFibGVDb2xsZWN0aW9uLnRzeA==) | `100.00% <0.00%> (ø)` | |
   | [superset/datasets/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YXNldHMvZmlsdGVycy5weQ==) | | |
   | [...s/3e1b21cd94a4\_change\_owner\_to\_m2m\_relation\_on\_.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8zZTFiMjFjZDk0YTRfY2hhbmdlX293bmVyX3RvX20ybV9yZWxhdGlvbl9vbl8ucHk=) | | |
   | ... and [636 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...c8fadb9](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] junlincc commented on pull request #12680: feat(dashboard-rbac): dashboard lists

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-770338128


   
   > having said that, we plan in a follow-up PR that user will be given temporary read access to all of the datasets within a dashboard as was mentioned in the development milestones in #10408
   
   
   Got it, thanks for adding test plan, and clarifying your plan going forward. we should expect a follow up PR to address both issues mentioned above. 


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (2826b77) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **decrease** coverage by `0.11%`.
   > The diff coverage is `47.05%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   63.13%   63.02%   -0.12%     
   ==========================================
     Files        1022     1022              
     Lines       50032    50139     +107     
     Branches     4915     5198     +283     
   ==========================================
   + Hits        31587    31598      +11     
   - Misses      18245    18326      +81     
   - Partials      200      215      +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.99% <ø> (+0.31%)` | :arrow_up: |
   | python | `63.69% <47.05%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.22% <100.00%> (+0.25%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `86.20% <0.00%> (-13.80%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [51 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...2826b77](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,241 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard", published=False, owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard", published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)

Review comment:
       `assert my_owned_dashboard.url in get_dashboards_response` just a simple assert




----------------------------------------------------------------
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 pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-766548269


   > can you vote please so we can move forward with this in a non-POC approach?
   
   Just saw it has passed. :D  Didn't notice you've updated the SIP summary. Thanks for iterating on your proposal.
   
   @dpgaspar's diagram makes perfect sense to me. Looks like things can be even simpler than I original thought. Maybe include the diagram in the SIP as a reference, too?


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (c560de8) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `5.85%`.
   > The diff coverage is `42.10%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   58.70%   -5.86%     
   ==========================================
     Files        1018      962      -56     
     Lines       49787    47007    -2780     
     Branches     4971     4386     -585     
   ==========================================
   - Hits        32141    27594    -4547     
   - Misses      17468    19413    +1945     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `50.58% <ø> (+13.38%)` | :arrow_up: |
   | javascript | `?` | |
   | python | `63.30% <42.10%> (-0.83%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.29% <100.00%> (+0.32%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...dashboard/components/resizable/ResizableHandle.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVIYW5kbGUuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.48%)` | :arrow_down: |
   | [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
   | [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
   | [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
   | ... and [462 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0b869a2](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (0223844) into [master](https://codecov.io/gh/apache/superset/commit/5504762458e127063e36f5aa149bbdf3f6fc8f80?el=desc) (5504762) will **decrease** coverage by `1.13%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   - Coverage   64.55%   63.42%   -1.14%     
   ==========================================
     Files        1018      487     -531     
     Lines       49787    30001   -19786     
     Branches     4971        0    -4971     
   ==========================================
   - Hits        32141    19027   -13114     
   + Misses      17468    10974    -6494     
   + Partials      178        0     -178     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.42% <50.00%> (-0.71%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.36% <100.00%> (+0.39%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.69% <0.00%> (-24.88%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/sql\_validators/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvYmFzZS5weQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `79.59% <0.00%> (-6.38%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | ... and [547 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [5504762...0223844](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] amitmiran137 commented on a change in pull request #12680: feat: dashboard access roles

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



##########
File path: tests/dashboards/security/security_dataset_tests.py
##########
@@ -0,0 +1,260 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for Superset"""
+import json
+
+import prison
+import pytest
+from flask import escape
+
+from superset import app, security_manager
+from superset.models import core as models
+from tests.dashboards.base_case import DashboardTestCase
+from tests.dashboards.consts import *
+from tests.dashboards.dashboard_test_utils import *
+from tests.dashboards.superset_factory_util import *
+from tests.fixtures.energy_dashboard import load_energy_table_with_slice
+
+
+# @mark.amit
+class TestDashboardDatasetSecurity(DashboardTestCase):
+    @pytest.fixture
+    def load_dashboard(self):
+        with app.app_context():
+            table = (
+                db.session.query(SqlaTable).filter_by(table_name="energy_usage").one()
+            )
+            # get a slice from the allowed table
+            slice = db.session.query(Slice).filter_by(slice_name="Energy Sankey").one()
+
+            self.grant_public_access_to_table(table)
+
+            pytest.hidden_dash_slug = f"hidden_dash_{random_slug()}"
+            pytest.published_dash_slug = f"published_dash_{random_slug()}"
+
+            # Create a published and hidden dashboard and add them to the database
+            published_dash = Dashboard()
+            published_dash.dashboard_title = "Published Dashboard"
+            published_dash.slug = pytest.published_dash_slug
+            published_dash.slices = [slice]
+            published_dash.published = True
+
+            hidden_dash = Dashboard()
+            hidden_dash.dashboard_title = "Hidden Dashboard"
+            hidden_dash.slug = pytest.hidden_dash_slug
+            hidden_dash.slices = [slice]
+            hidden_dash.published = False
+
+            db.session.merge(published_dash)
+            db.session.merge(hidden_dash)
+            yield db.session.commit()
+
+            self.revoke_public_access_to_table(table)
+            db.session.delete(published_dash)
+            db.session.delete(hidden_dash)
+            db.session.commit()
+
+    def test_dashboard_access__admin_can_access_all(self):
+        # arrange
+        self.login(username=ADMIN_USERNAME)
+        dashboard_title_by_url = {
+            dash.url: dash.dashboard_title for dash in get_all_dashboards()
+        }
+
+        # act
+        responses_by_url = {
+            url: self.client.get(url).data.decode("utf-8")
+            for url in dashboard_title_by_url.keys()
+        }
+
+        # assert
+        for dashboard_url, get_dashboard_response in responses_by_url.items():
+            assert (
+                escape(dashboard_title_by_url[dashboard_url]) in get_dashboard_response
+            )
+
+    def test_get_dashboards__users_are_dashboards_owners(self):
+        # arrange
+        username = "gamma"
+        user = security_manager.find_user(username)
+        my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="My Dashboard",
+            slug=f"my_dash_{random_slug()}",
+            published=False,
+            owners=[user],
+        )
+
+        not_my_owned_dashboard = create_dashboard_to_db(
+            dashboard_title="Not My Dashboard",
+            slug=f"not_my_dash_{random_slug()}",
+            published=False,
+        )
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(my_owned_dashboard.url, get_dashboards_response)
+        self.assertNotIn(not_my_owned_dashboard.url, get_dashboards_response)
+
+    def test_get_dashboards__owners_can_view_empty_dashboard(self):
+        # arrange
+        dash = create_dashboard_to_db("Empty Dashboard", slug="empty_dashboard")
+        dashboard_url = dash.url
+        gamma_user = security_manager.find_user("gamma")
+        self.login(gamma_user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertNotIn(dashboard_url, get_dashboards_response)
+
+    def test_get_dashboards__users_can_view_favorites_dashboards(self):
+        # arrange
+        user = security_manager.find_user("gamma")
+        fav_dash_slug = f"my_favorite_dash_{random_slug()}"
+        regular_dash_slug = f"regular_dash_{random_slug()}"
+
+        favorite_dash = Dashboard()
+        favorite_dash.dashboard_title = "My Favorite Dashboard"
+        favorite_dash.slug = fav_dash_slug
+
+        regular_dash = Dashboard()
+        regular_dash.dashboard_title = "A Plain Ol Dashboard"
+        regular_dash.slug = regular_dash_slug
+
+        db.session.merge(favorite_dash)
+        db.session.merge(regular_dash)
+        db.session.commit()
+
+        dash = db.session.query(Dashboard).filter_by(slug=fav_dash_slug).first()
+
+        favorites = models.FavStar()
+        favorites.obj_id = dash.id
+        favorites.class_name = "Dashboard"
+        favorites.user_id = user.id
+
+        db.session.merge(favorites)
+        db.session.commit()
+
+        self.login(user.username)
+
+        # act
+        get_dashboards_response = self.get_resp(DASHBOARDS_API_URL)
+
+        # assert
+        self.assertIn(f"/superset/dashboard/{fav_dash_slug}/", get_dashboards_response)

Review comment:
       actually for a reason which is unclear to me access to fav dashboards is managed just by setting the fav.
   even without any data/role access
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L106
   
   is it a mistake?
   bc we already have the 
   https://github.com/apache/superset/blob/f6c7cbeeb40a3f1400ecc8e1b6b371b008f67397/superset/dashboards/filters.py#L106
   which handles filters favs on top of access
   




----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543






----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (812bb87) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.60%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.73%   +0.60%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30195   -19837     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19245   -12342     
   + Misses      18245    10950    -7295     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.73% <60.86%> (-0.36%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | [superset/utils/celery.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2VsZXJ5LnB5) | `89.65% <0.00%> (-10.35%)` | :arrow_down: |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <0.00%> (-8.77%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.38% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [552 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...812bb87](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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-io edited a comment on pull request #12680: feat: dashboard access roles

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12680:
URL: https://github.com/apache/superset/pull/12680#issuecomment-765242543


   # [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=h1) Report
   > Merging [#12680](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=desc) (ac45a58) into [master](https://codecov.io/gh/apache/superset/commit/017f11f9d84ac88019a6c42eb65a67b617966e95?el=desc) (017f11f) will **increase** coverage by `0.24%`.
   > The diff coverage is `60.86%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12680/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12680      +/-   ##
   ==========================================
   + Coverage   63.13%   63.38%   +0.24%     
   ==========================================
     Files        1022      489     -533     
     Lines       50032    30180   -19852     
     Branches     4915        0    -4915     
   ==========================================
   - Hits        31587    19129   -12458     
   + Misses      18245    11051    -7194     
   + Partials      200        0     -200     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `63.38% <60.86%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.61% <ø> (ø)` | |
   | [...11ccdd12658\_add\_roles\_relationship\_to\_dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy8xMWNjZGQxMjY1OF9hZGRfcm9sZXNfcmVsYXRpb25zaGlwX3RvX2Rhc2hib2FyZC5weQ==) | `0.00% <0.00%> (ø)` | |
   | [superset/views/dashboard/mixin.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL21peGluLnB5) | `95.00% <ø> (ø)` | |
   | [superset/dashboards/filters.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9maWx0ZXJzLnB5) | `97.61% <100.00%> (+0.64%)` | :arrow_up: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.74% <100.00%> (+0.24%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `73.84% <0.00%> (-17.31%)` | :arrow_down: |
   | ... and [571 more](https://codecov.io/gh/apache/superset/pull/12680/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=footer). Last update [017f11f...ac45a58](https://codecov.io/gh/apache/superset/pull/12680?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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