From 2aa3f8cb4a2c8a137a9f71d6e69db458a6cd5724 Mon Sep 17 00:00:00 2001 From: shunki-fujita Date: Tue, 25 Nov 2025 09:16:53 +0000 Subject: [PATCH 1/2] fix(roles): add missing SQLLab permissions for estimate and format Signed-off-by: shunki-fujita --- superset/security/manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/security/manager.py b/superset/security/manager.py index f173da512e2f..f62930c4bf46 100644 --- a/superset/security/manager.py +++ b/superset/security/manager.py @@ -357,7 +357,8 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods ("can_export_csv", "Query"), ("can_get_results", "SQLLab"), ("can_execute_sql_query", "SQLLab"), - ("can_estimate_query_cost", "SQL Lab"), + ("can_estimate_query_cost", "SQLLab"), + ("can_format_sql", "SQLLab"), ("can_export_csv", "SQLLab"), ("can_read", "SQLLab"), ("can_sqllab_history", "Superset"), From 885a1ddb327c6557cc2cdc707519e94739f13875 Mon Sep 17 00:00:00 2001 From: shunki-fujita Date: Thu, 27 Nov 2025 01:33:57 +0000 Subject: [PATCH 2/2] fix(roles): Add testcase for sql_lab role permissions --- tests/integration_tests/security_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration_tests/security_tests.py b/tests/integration_tests/security_tests.py index 7aba9ffd3413..4dc32e8381ce 100644 --- a/tests/integration_tests/security_tests.py +++ b/tests/integration_tests/security_tests.py @@ -1474,9 +1474,11 @@ def test_sql_lab_permissions(self): ("can_csv", "Superset"), ("can_delete_query", "TabStateView"), ("can_delete", "TabStateView"), + ('can_estimate_query_cost', 'SQLLab'), ("can_execute_sql_query", "SQLLab"), ("can_export", "SavedQuery"), ("can_export_csv", "SQLLab"), + ('can_format_sql', 'SQLLab'), ("can_get", "TabStateView"), ("can_get_results", "SQLLab"), ("can_migrate_query", "TabStateView"),