Avoid circular dependency between superset config and superset package (#8254)

Resolve comments

Avoid circular dependency between superset config and superset package

Resolve comments
This commit is contained in:
Bogdan 2019-12-10 01:17:34 -08:00 committed by Daniel Vaz Gaspar
parent 7f8db7ab8d
commit e6be51953c
3 changed files with 21 additions and 4 deletions

View File

@ -0,0 +1,17 @@
# 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 superset.security.manager import SupersetSecurityManager # noqa: F401

View File

@ -399,7 +399,7 @@ class RolePermissionTests(SupersetTestCase):
# TODO test slice permission
@patch("superset.security.g")
@patch("superset.security.manager.g")
def test_schemas_accessible_by_user_admin(self, mock_g):
mock_g.user = security_manager.find_user("admin")
with self.client.application.test_request_context():
@ -409,7 +409,7 @@ class RolePermissionTests(SupersetTestCase):
)
self.assertEquals(schemas, ["1", "2", "3"]) # no changes
@patch("superset.security.g")
@patch("superset.security.manager.g")
def test_schemas_accessible_by_user_schema_access(self, mock_g):
# User has schema access to the schema 1
create_schema_perm("[examples].[1]")
@ -423,7 +423,7 @@ class RolePermissionTests(SupersetTestCase):
self.assertEquals(schemas, ["1"])
delete_schema_perm("[examples].[1]")
@patch("superset.security.g")
@patch("superset.security.manager.g")
def test_schemas_accessible_by_user_datasource_access(self, mock_g):
# User has schema access to the datasource temp_schema.wb_health_population in examples DB.
mock_g.user = security_manager.find_user("gamma")
@ -434,7 +434,7 @@ class RolePermissionTests(SupersetTestCase):
)
self.assertEquals(schemas, ["temp_schema"])
@patch("superset.security.g")
@patch("superset.security.manager.g")
def test_schemas_accessible_by_user_datasource_and_schema_access(self, mock_g):
# User has schema access to the datasource temp_schema.wb_health_population in examples DB.
create_schema_perm("[examples].[2]")