mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
fix: reorganize role permissions (#23096)
This commit is contained in:
committed by
GitHub
parent
c7823e32ff
commit
d4362a3676
@@ -202,6 +202,10 @@ class TestQueryApi(SupersetTestCase):
|
||||
gamma2 = self.create_user(
|
||||
"gamma_2", "password", "Gamma", email="gamma2@superset.org"
|
||||
)
|
||||
# Add SQLLab role to these gamma users, so they have access to queries
|
||||
sqllab_role = self.get_role("sql_lab")
|
||||
gamma1.roles.append(sqllab_role)
|
||||
gamma2.roles.append(sqllab_role)
|
||||
|
||||
gamma1_client_id = self.get_random_string()
|
||||
gamma2_client_id = self.get_random_string()
|
||||
@@ -383,7 +387,7 @@ class TestQueryApi(SupersetTestCase):
|
||||
sql="SELECT col1, col2 from table1",
|
||||
)
|
||||
|
||||
self.login(username="gamma")
|
||||
self.login(username="gamma_sqllab")
|
||||
arguments = {"filters": [{"col": "sql", "opr": "sw", "value": "SELECT col1"}]}
|
||||
uri = f"api/v1/query/?q={prison.dumps(arguments)}"
|
||||
rv = self.client.get(uri)
|
||||
|
||||
@@ -748,7 +748,7 @@ class TestSavedQueryApi(SupersetTestCase):
|
||||
db.session.query(SavedQuery).filter(SavedQuery.created_by == admin).first()
|
||||
)
|
||||
|
||||
self.login(username="gamma")
|
||||
self.login(username="gamma_sqllab")
|
||||
argument = [sample_query.id]
|
||||
uri = f"api/v1/saved_query/export/?q={prison.dumps(argument)}"
|
||||
rv = self.client.get(uri)
|
||||
|
||||
Reference in New Issue
Block a user