From e678c51a649c7f06bfc4b225491935272b8d225d Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 17 Aug 2023 18:38:00 -0400 Subject: [PATCH 1/7] feat: defining student rol --- tutoraspects/plugin.py | 1 + .../aspects/apps/superset/security/roles.json | 1024 +++++++++++++++++ 2 files changed, 1025 insertions(+) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index 06db70f7..f96b51ad 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -162,6 +162,7 @@ "instructor": "Instructor", "operator": "Operator", "admin": "Admin", + "student": "Student", }, ), ("SUPERSET_ADMIN_EMAIL", "admin@openedx.org"), diff --git a/tutoraspects/templates/aspects/apps/superset/security/roles.json b/tutoraspects/templates/aspects/apps/superset/security/roles.json index 7d0f45f3..88986c86 100644 --- a/tutoraspects/templates/aspects/apps/superset/security/roles.json +++ b/tutoraspects/templates/aspects/apps/superset/security/roles.json @@ -5094,8 +5094,1032 @@ } } ] + }, + { + "name":"{{SUPERSET_ROLES_MAPPING.student}}", + "permissions":[ + { + "permission":{ + "name":"schema_access" + }, + "view_menu":{ + "name":"[OpenedX Clickhouse].[xapi]" + } + }, + { + "permission":{ + "name":"can_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"CssTemplate" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dataset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Database" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Query" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"AdvancedDataType" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"EmbeddedDashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExploreFormDataRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SecurityRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_userinfo" + }, + "view_menu":{ + "name":"UserOAuthModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"AsyncEventsRestApi" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_edit" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_add" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"SwaggerView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"OpenApi" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"MenuApi" + } + }, + { + "permission":{ + "name":"all_datasource_access" + }, + "view_menu":{ + "name":"all_datasource_access" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_invalidate" + }, + "view_menu":{ + "name":"CacheRestApi" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_get_embedded" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_import_" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_query_form_data" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_query" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_time_range" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_external_metadata_by_name" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_external_metadata" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get_value" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_store" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_my_queries" + }, + "view_menu":{ + "name":"SqlLab" + } + }, + { + "permission":{ + "name":"can_user_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards_by_username" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_warm_up_cache" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_save_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_add_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_annotation_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_csv" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_schemas_access_for_file_upload" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_profile" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_explore_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_log" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_results" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_validate_sql_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_estimate_query_cost" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_available_domains" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_testconn" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_extra_table_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_search_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_datasources" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_filter" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_recent_activity" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_table_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fetch_datasource_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_history" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_favstar" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_stop_query" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_copy_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_dashboard_permalink" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_request_access" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_expanded" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_put" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_migrate_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_activate" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_suggestions" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_tagged_objects" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Users" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Roles" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"User's Statistics" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Action Log" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Access requests" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Home" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Annotation Layers" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Plugins" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Alerts & Report" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Dashboards" + } + }, + { + "permission":{ + "name":"can_share_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_share_chart" + }, + "view_menu":{ + "name":"Superset" + } + } + ] } {% for role in SUPERSET_SUPPORTED_LANGUAGES %},{ + "name": "{{SUPERSET_ROLES_MAPPING.student}} - {{role}}", + "permissions": [] + },{ "name": "{{SUPERSET_ROLES_MAPPING.instructor}} - {{role}}", "permissions": [] },{ From 6b81a55bc46af07147d74134eabfd5a4d5640b8f Mon Sep 17 00:00:00 2001 From: Fernando Date: Mon, 21 Aug 2023 10:40:07 -0400 Subject: [PATCH 2/7] fix: student and instructor permissions template and some student role configurations --- .../openedx_sso_security_manager.py | 8 +- .../pythonpath/superset_config_docker.py | 2 + .../aspects/apps/superset/security/roles.json | 3066 ++++++----------- 3 files changed, 1034 insertions(+), 2042 deletions(-) diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py index b8da0490..67198cee 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py @@ -174,9 +174,11 @@ def _get_user_roles(self, username, language): return ["instructor", f"instructor-{language}"] else: roles = self.extra_get_user_roles(username, decoded_access_token) - if bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}") and not roles: - raise Exception(f"Student {username} tried to access Superset") - return roles if roles else [] + if roles: + return roles + if not bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}"): + return ["student", f"student - {language}"] + raise Exception(f"Student {username} tried to access Superset") def extra_get_user_roles(self, username, decoded_access_token): """ diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py index b6ec6b23..415327f0 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py @@ -63,12 +63,14 @@ "alpha": ["Alpha"], # Global staff "gamma": ["Gamma"], # Course staff "instructor": ["{{SUPERSET_ROLES_MAPPING.instructor}}"], # Course instructors + "student": ["{{SUPERSET_ROLES_MAPPING.student}}"], # Course students "operator": ["{{SUPERSET_ROLES_MAPPING.operator}}"], # Installation operators "public": ["Public"], # AKA anonymous users } for language in LANGUAGES.keys(): AUTH_ROLES_MAPPING[f"instructor-{language}"] = [f"{{SUPERSET_ROLES_MAPPING.instructor}} - {language}"] + AUTH_ROLES_MAPPING[f"student-{language}"] = [f"{{SUPERSET_ROLES_MAPPING.student}} - {language}"] from openedx_sso_security_manager import OpenEdxSsoSecurityManager diff --git a/tutoraspects/templates/aspects/apps/superset/security/roles.json b/tutoraspects/templates/aspects/apps/superset/security/roles.json index 88986c86..73d76348 100644 --- a/tutoraspects/templates/aspects/apps/superset/security/roles.json +++ b/tutoraspects/templates/aspects/apps/superset/security/roles.json @@ -1,4 +1,1025 @@ [ + {% macro permission_student_intructor_list() %} + [ + { + "permission":{ + "name":"schema_access" + }, + "view_menu":{ + "name":"[OpenedX Clickhouse].[xapi]" + } + }, + { + "permission":{ + "name":"can_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"CssTemplate" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dataset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Database" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Query" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"AdvancedDataType" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"EmbeddedDashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExploreFormDataRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SecurityRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_userinfo" + }, + "view_menu":{ + "name":"UserOAuthModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"AsyncEventsRestApi" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_edit" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_add" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"SwaggerView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"OpenApi" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"MenuApi" + } + }, + { + "permission":{ + "name":"all_datasource_access" + }, + "view_menu":{ + "name":"all_datasource_access" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_invalidate" + }, + "view_menu":{ + "name":"CacheRestApi" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_get_embedded" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_import_" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_query_form_data" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_query" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_time_range" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_external_metadata_by_name" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_external_metadata" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get_value" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_store" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_my_queries" + }, + "view_menu":{ + "name":"SqlLab" + } + }, + { + "permission":{ + "name":"can_user_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards_by_username" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_warm_up_cache" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_save_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_add_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_annotation_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_csv" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_schemas_access_for_file_upload" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_profile" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_explore_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_log" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_results" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_validate_sql_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_estimate_query_cost" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_available_domains" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_testconn" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_extra_table_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_search_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_datasources" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_filter" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_recent_activity" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_table_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fetch_datasource_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_history" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_favstar" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_stop_query" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_copy_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_dashboard_permalink" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_request_access" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_expanded" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_put" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_migrate_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_activate" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_suggestions" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_tagged_objects" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Users" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Roles" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"User's Statistics" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Action Log" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Access requests" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Home" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Annotation Layers" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Plugins" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Alerts & Report" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Dashboards" + } + }, + { + "permission":{ + "name":"can_share_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_share_chart" + }, + "view_menu":{ + "name":"Superset" + } + } + ] + {% end macro %} + { "name":"{{SUPERSET_ROLES_MAPPING.admin}}", "permissions":[ @@ -4076,2046 +5097,13 @@ }, { "name":"{{SUPERSET_ROLES_MAPPING.instructor}}", - "permissions":[ - { - "permission":{ - "name":"schema_access" - }, - "view_menu":{ - "name":"[OpenedX Clickhouse].[xapi]" - } - }, - { - "permission":{ - "name":"can_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"CssTemplate" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dataset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Database" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Query" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"AdvancedDataType" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"EmbeddedDashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExploreFormDataRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SecurityRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_userinfo" - }, - "view_menu":{ - "name":"UserOAuthModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"AsyncEventsRestApi" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_edit" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_add" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"SwaggerView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"OpenApi" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"MenuApi" - } - }, - { - "permission":{ - "name":"all_datasource_access" - }, - "view_menu":{ - "name":"all_datasource_access" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_invalidate" - }, - "view_menu":{ - "name":"CacheRestApi" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_get_embedded" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_import_" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_query_form_data" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_query" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_time_range" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_external_metadata_by_name" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_external_metadata" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get_value" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_store" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_my_queries" - }, - "view_menu":{ - "name":"SqlLab" - } - }, - { - "permission":{ - "name":"can_user_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards_by_username" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_warm_up_cache" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_save_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_add_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_annotation_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_csv" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_schemas_access_for_file_upload" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_profile" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_explore_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_log" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_results" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_validate_sql_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_estimate_query_cost" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_available_domains" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_testconn" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_extra_table_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_search_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_datasources" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_filter" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_recent_activity" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_table_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fetch_datasource_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_history" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_favstar" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_stop_query" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_copy_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_dashboard_permalink" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_request_access" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_expanded" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_put" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_migrate_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_activate" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_suggestions" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_tagged_objects" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Users" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Roles" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"User's Statistics" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Action Log" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Access requests" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Home" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Annotation Layers" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Plugins" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Alerts & Report" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Dashboards" - } - }, - { - "permission":{ - "name":"can_share_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_share_chart" - }, - "view_menu":{ - "name":"Superset" - } - } - ] - }, - { - "name":"{{SUPERSET_ROLES_MAPPING.student}}", - "permissions":[ - { - "permission":{ - "name":"schema_access" - }, - "view_menu":{ - "name":"[OpenedX Clickhouse].[xapi]" - } - }, - { - "permission":{ - "name":"can_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"CssTemplate" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dataset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Database" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Query" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"AdvancedDataType" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"EmbeddedDashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExploreFormDataRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SecurityRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_userinfo" - }, - "view_menu":{ - "name":"UserOAuthModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"AsyncEventsRestApi" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_edit" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_add" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"SwaggerView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"OpenApi" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"MenuApi" - } - }, - { - "permission":{ - "name":"all_datasource_access" - }, - "view_menu":{ - "name":"all_datasource_access" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_invalidate" - }, - "view_menu":{ - "name":"CacheRestApi" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_get_embedded" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_import_" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_query_form_data" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_query" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_time_range" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_external_metadata_by_name" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_external_metadata" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get_value" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_store" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_my_queries" - }, - "view_menu":{ - "name":"SqlLab" - } - }, - { - "permission":{ - "name":"can_user_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards_by_username" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_warm_up_cache" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_save_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_add_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_annotation_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_csv" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_schemas_access_for_file_upload" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_profile" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_explore_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_log" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_results" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_validate_sql_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_estimate_query_cost" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_available_domains" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_testconn" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_extra_table_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_search_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_datasources" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_filter" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_recent_activity" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_table_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fetch_datasource_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_history" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_favstar" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_stop_query" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_copy_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_dashboard_permalink" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_request_access" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_expanded" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_put" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_migrate_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_activate" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_suggestions" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_tagged_objects" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Users" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Roles" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"User's Statistics" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Action Log" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Access requests" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Home" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Annotation Layers" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Plugins" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Alerts & Report" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Dashboards" - } - }, - { - "permission":{ - "name":"can_share_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_share_chart" - }, - "view_menu":{ - "name":"Superset" - } - } - ] + "permissions": {{ permission_student_intructor_list()|tojson }} + }, + { + "name":"{{SUPERSET_ROLES_MAPPING.student}}", + "permissions": {{ permission_student_intructor_list()|tojson }} } + {% for role in SUPERSET_SUPPORTED_LANGUAGES %},{ "name": "{{SUPERSET_ROLES_MAPPING.student}} - {{role}}", "permissions": [] From ba8439bdc3951b09d74aade7c82610b362d1395c Mon Sep 17 00:00:00 2001 From: Fernando Date: Mon, 21 Aug 2023 11:46:14 -0400 Subject: [PATCH 3/7] fix: Jinja correction --- .../templates/aspects/apps/superset/security/roles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutoraspects/templates/aspects/apps/superset/security/roles.json b/tutoraspects/templates/aspects/apps/superset/security/roles.json index 73d76348..cbff4000 100644 --- a/tutoraspects/templates/aspects/apps/superset/security/roles.json +++ b/tutoraspects/templates/aspects/apps/superset/security/roles.json @@ -1018,7 +1018,7 @@ } } ] - {% end macro %} + {% endmacro %} { "name":"{{SUPERSET_ROLES_MAPPING.admin}}", From 850199f9973aadd64c99fc8bf29ec26fe173adcd Mon Sep 17 00:00:00 2001 From: Fernando Date: Tue, 22 Aug 2023 15:28:16 -0400 Subject: [PATCH 4/7] fix: read_only_permission.json created and operator included in language loop --- config.yml | 62 + .../pythonpath/superset_config_docker.py | 1 + .../partials/read_only_permissions.json | 1018 ++++++++++++++++ .../aspects/apps/superset/security/roles.json | 1025 +---------------- 4 files changed, 1083 insertions(+), 1023 deletions(-) create mode 100644 config.yml create mode 100644 tutoraspects/templates/aspects/apps/superset/security/partials/read_only_permissions.json diff --git a/config.yml b/config.yml new file mode 100644 index 00000000..1b50ef04 --- /dev/null +++ b/config.yml @@ -0,0 +1,62 @@ +CMS_OAUTH2_SECRET: mUDPC0mAIsrI55e6ewLCpOAF +ID: jV4UITdO51qynTEP6EWBEYIA +JWT_RSA_PRIVATE_KEY: '-----BEGIN RSA PRIVATE KEY----- + + MIIEogIBAAKCAQEAs24MJudBS4NvRqY3lXpz4XnaPWeCMie5iQbqT1oBV47BXlqq + + rqjCv6ajKNlW2cM2qpeDn1T/5CCFY1a0uBmft/GqHFjpiyh8gnvLP8fiqdM+YzGe + + RdyucbND0LTLNp14E4wEiK7s/lLUXe0mqsiFJCDumedHlm1e21AF+PZJ4xkpLL3d + + OUVke+8OOuOIOfGjXP5a6COUOTqPmPH51L2tP6/b/6vmSOYDja9GyUwJf8IJqDFx + + x/MbLqtkQJ22Ho7sxQbidHjY1LNnkzOOo5E1zOzK65Oayz+RDTAetvhP8FpbclN1 + + jLnyGxOakfnQ9npqukjzzmucrcSF3sC1S/nicQIDAQABAoIBAAWcjld8ocWEcKtZ + + WTFs9RkTBCTpuvAJ30L2cwdEibh0694BMKeZ+k4/XkixpGZW1Tu4VZra8A5QyI8q + + 5+e+kGjSr2bnznUGUP+NMtX1sMRuKXw1ce1eKZv/duJc9yKIAfh9h2pFaz7IdSET + + YMNUVlqjB4dLbQkatk3eVrN6s2SdaEKChKT4cOoknZVjd7y6d+iRNBlYxTQ4EuMH + + C0+JzHBxcUvtW8t2WRZAGkT46QDup8JNH/9STE0DJuPXhU+pvpXA90/b5cwm31Eo + + DKURa2wWk3916fkhkVxGJoiKkXLCweLqNjrFm+Nz8TZAb6x8gkbcG9CwUsXMWFk4 + + 2sEN3QkCgYEAxjUcCYjwmSTRPQJebcVwe9oT3Edg8XLPEGDtOzeBuNK8OUd+kRPi + + nc+YI3aLq0Q907rJLtiLQyT0TslB5M0zC7X8liDqPqvq3LViajKT+dyT496rL3Qd + + gWsUaplZAAAJjFHCwoiOUXTiJh/+2D0M4jtnyPmTDy3Q34hVHpAUC6kCgYEA579Q + + X0xWXrJ+Sl/HfPI5CcfQ6oE9OEBl1PtbRjcNNqPESKqjHi3sRN2eqyjDJm/kfECD + + F+3atMrxWMHjiNoyTZEOQWtfDs+BPlhwgm4jwG0vmK+mLun27KpFsb/3FnF3/nVw + + UPibJN1bqpjGWcwv4JkvfVKSlPKMmpKo2wzxnYkCgYAt4GMR7elKeRQZG/BBVh63 + + +/z20mqk2B8HOngOacWTwusgEuU/rSuZvVAIfUrMpGnvFN+2ARcSvn3xsnGXBMvY + + 3RGOqiWtxdsBpNYXoIdRoPV2G7bhr+2YY/GAzuejsV6EZPRAVJ0kS3qAuo0g/dh6 + + kKdwBBw+uisLYiHZhh2tqQKBgBv3nZZymvXAqrcFCgkNHk8M2yyBvkaclu12DBTU + + LfcLGnP+i8LnndzNtglH2Q05caSBEJEBtmQdHbUtaO0qD+oGeGbysz0RU7KXb7R9 + + 4DintJfDktWUjKURA2opFYOS2/1MZOqQpgBz6k0TNNS/bIO5WN7R6TiqcMdyrYgJ + + 7tqpAoGAZRrwIiVB26uqqTsalF/bnIU2e6ir9UmqR+BAljm2sKLzUcU1PH8H+j1p + + DnD91xqkUbXBiYPnGgvCetk+vazoTeOjJjA3USlO4h+b44tnL5YqHc3c73f2bol5 + + hMoSDyn5uIPeWlQrbSLoi+W/e+45CiGAmM2IK6urIcq5gpjQS44= + + -----END RSA PRIVATE KEY-----' +MYSQL_ROOT_PASSWORD: LIYV7fuy +OPENEDX_MYSQL_PASSWORD: nZERSPxK +OPENEDX_SECRET_KEY: PHI9tC5jFehfRxSBsSHTSpyv +PLUGINS: +- mfe +PLUGIN_INDEXES: +- https://overhang.io/tutor/main diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py index 415327f0..467939a0 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py @@ -71,6 +71,7 @@ for language in LANGUAGES.keys(): AUTH_ROLES_MAPPING[f"instructor-{language}"] = [f"{{SUPERSET_ROLES_MAPPING.instructor}} - {language}"] AUTH_ROLES_MAPPING[f"student-{language}"] = [f"{{SUPERSET_ROLES_MAPPING.student}} - {language}"] + AUTH_ROLES_MAPPING[f"operator-{language}"] = [f"{{SUPERSET_ROLES_MAPPING.operator}} - {language}"] from openedx_sso_security_manager import OpenEdxSsoSecurityManager diff --git a/tutoraspects/templates/aspects/apps/superset/security/partials/read_only_permissions.json b/tutoraspects/templates/aspects/apps/superset/security/partials/read_only_permissions.json new file mode 100644 index 00000000..836ac074 --- /dev/null +++ b/tutoraspects/templates/aspects/apps/superset/security/partials/read_only_permissions.json @@ -0,0 +1,1018 @@ +[ + { + "permission":{ + "name":"schema_access" + }, + "view_menu":{ + "name":"[OpenedX Clickhouse].[xapi]" + } + }, + { + "permission":{ + "name":"can_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"CssTemplate" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dataset" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Database" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"Query" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"AdvancedDataType" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"EmbeddedDashboard" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExploreFormDataRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_read" + }, + "view_menu":{ + "name":"SecurityRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ReportSchedule" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"Annotation" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardFilterStateRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"DashboardPermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_write" + }, + "view_menu":{ + "name":"ExplorePermalinkRestApi" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_post" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ResetMyPasswordView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"UserInfoEditView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"CsvToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ExcelToDatabaseView" + } + }, + { + "permission":{ + "name":"can_this_form_get" + }, + "view_menu":{ + "name":"ColumnarToDatabaseView" + } + }, + { + "permission":{ + "name":"can_userinfo" + }, + "view_menu":{ + "name":"UserOAuthModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"AsyncEventsRestApi" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_list" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_edit" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_add" + }, + "view_menu":{ + "name":"FilterSets" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"RegisterUserModelView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"SwaggerView" + } + }, + { + "permission":{ + "name":"can_show" + }, + "view_menu":{ + "name":"DynamicPlugin" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"OpenApi" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"MenuApi" + } + }, + { + "permission":{ + "name":"all_datasource_access" + }, + "view_menu":{ + "name":"all_datasource_access" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_get" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_invalidate" + }, + "view_menu":{ + "name":"CacheRestApi" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"SavedQuery" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"Chart" + } + }, + { + "permission":{ + "name":"can_export" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_get_embedded" + }, + "view_menu":{ + "name":"Dashboard" + } + }, + { + "permission":{ + "name":"can_import_" + }, + "view_menu":{ + "name":"ImportExportRestApi" + } + }, + { + "permission":{ + "name":"can_query_form_data" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_query" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_time_range" + }, + "view_menu":{ + "name":"Api" + } + }, + { + "permission":{ + "name":"can_external_metadata_by_name" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_external_metadata" + }, + "view_menu":{ + "name":"Datasource" + } + }, + { + "permission":{ + "name":"can_get_value" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_store" + }, + "view_menu":{ + "name":"KV" + } + }, + { + "permission":{ + "name":"can_my_queries" + }, + "view_menu":{ + "name":"SqlLab" + } + }, + { + "permission":{ + "name":"can_user_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_created_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards_by_username" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_warm_up_cache" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_save_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_add_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_annotation_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_csv" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_schemas_access_for_file_upload" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_slices" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_profile" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_explore_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_log" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_results" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_validate_sql_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_estimate_query_cost" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_available_domains" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_testconn" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_extra_table_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_search_queries" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_datasources" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_filter" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fave_dashboards" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_recent_activity" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_table_viz" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_fetch_datasource_metadata" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_sqllab_history" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_favstar" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_slice_json" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_stop_query" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_copy_dash" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_dashboard_permalink" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_request_access" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_post" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_expanded" + }, + "view_menu":{ + "name":"TableSchemaView" + } + }, + { + "permission":{ + "name":"can_put" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_delete_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_migrate_query" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_activate" + }, + "view_menu":{ + "name":"TabStateView" + } + }, + { + "permission":{ + "name":"can_suggestions" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"can_tagged_objects" + }, + "view_menu":{ + "name":"TagView" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Users" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"List Roles" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"User's Statistics" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Action Log" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Access requests" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Home" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Annotation Layers" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Plugins" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Alerts & Report" + } + }, + { + "permission":{ + "name":"menu_access" + }, + "view_menu":{ + "name":"Dashboards" + } + }, + { + "permission":{ + "name":"can_share_dashboard" + }, + "view_menu":{ + "name":"Superset" + } + }, + { + "permission":{ + "name":"can_share_chart" + }, + "view_menu":{ + "name":"Superset" + } + } +] \ No newline at end of file diff --git a/tutoraspects/templates/aspects/apps/superset/security/roles.json b/tutoraspects/templates/aspects/apps/superset/security/roles.json index cbff4000..60f99fdd 100644 --- a/tutoraspects/templates/aspects/apps/superset/security/roles.json +++ b/tutoraspects/templates/aspects/apps/superset/security/roles.json @@ -1,1025 +1,4 @@ [ - {% macro permission_student_intructor_list() %} - [ - { - "permission":{ - "name":"schema_access" - }, - "view_menu":{ - "name":"[OpenedX Clickhouse].[xapi]" - } - }, - { - "permission":{ - "name":"can_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"CssTemplate" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dataset" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Database" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"Query" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"AdvancedDataType" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"EmbeddedDashboard" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExploreFormDataRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_read" - }, - "view_menu":{ - "name":"SecurityRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ReportSchedule" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"Annotation" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardFilterStateRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"DashboardPermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_write" - }, - "view_menu":{ - "name":"ExplorePermalinkRestApi" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_post" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ResetMyPasswordView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"UserInfoEditView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"CsvToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ExcelToDatabaseView" - } - }, - { - "permission":{ - "name":"can_this_form_get" - }, - "view_menu":{ - "name":"ColumnarToDatabaseView" - } - }, - { - "permission":{ - "name":"can_userinfo" - }, - "view_menu":{ - "name":"UserOAuthModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"AsyncEventsRestApi" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_list" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_edit" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_add" - }, - "view_menu":{ - "name":"FilterSets" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"RegisterUserModelView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"SwaggerView" - } - }, - { - "permission":{ - "name":"can_show" - }, - "view_menu":{ - "name":"DynamicPlugin" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"OpenApi" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"MenuApi" - } - }, - { - "permission":{ - "name":"all_datasource_access" - }, - "view_menu":{ - "name":"all_datasource_access" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_get" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_invalidate" - }, - "view_menu":{ - "name":"CacheRestApi" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"SavedQuery" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"Chart" - } - }, - { - "permission":{ - "name":"can_export" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_get_embedded" - }, - "view_menu":{ - "name":"Dashboard" - } - }, - { - "permission":{ - "name":"can_import_" - }, - "view_menu":{ - "name":"ImportExportRestApi" - } - }, - { - "permission":{ - "name":"can_query_form_data" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_query" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_time_range" - }, - "view_menu":{ - "name":"Api" - } - }, - { - "permission":{ - "name":"can_external_metadata_by_name" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_external_metadata" - }, - "view_menu":{ - "name":"Datasource" - } - }, - { - "permission":{ - "name":"can_get_value" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_store" - }, - "view_menu":{ - "name":"KV" - } - }, - { - "permission":{ - "name":"can_my_queries" - }, - "view_menu":{ - "name":"SqlLab" - } - }, - { - "permission":{ - "name":"can_user_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_created_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards_by_username" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_warm_up_cache" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_save_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_add_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_annotation_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_csv" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_schemas_access_for_file_upload" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_slices" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_profile" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_explore_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_log" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_results" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_validate_sql_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_estimate_query_cost" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_available_domains" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_testconn" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_extra_table_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_search_queries" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_datasources" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_filter" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fave_dashboards" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_recent_activity" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_table_viz" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_fetch_datasource_metadata" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_sqllab_history" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_favstar" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_slice_json" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_stop_query" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_copy_dash" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_dashboard_permalink" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_request_access" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_post" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_expanded" - }, - "view_menu":{ - "name":"TableSchemaView" - } - }, - { - "permission":{ - "name":"can_put" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_delete_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_migrate_query" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_activate" - }, - "view_menu":{ - "name":"TabStateView" - } - }, - { - "permission":{ - "name":"can_suggestions" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"can_tagged_objects" - }, - "view_menu":{ - "name":"TagView" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Users" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"List Roles" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"User's Statistics" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Action Log" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Access requests" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Home" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Annotation Layers" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Plugins" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Alerts & Report" - } - }, - { - "permission":{ - "name":"menu_access" - }, - "view_menu":{ - "name":"Dashboards" - } - }, - { - "permission":{ - "name":"can_share_dashboard" - }, - "view_menu":{ - "name":"Superset" - } - }, - { - "permission":{ - "name":"can_share_chart" - }, - "view_menu":{ - "name":"Superset" - } - } - ] - {% endmacro %} - { "name":"{{SUPERSET_ROLES_MAPPING.admin}}", "permissions":[ @@ -5097,11 +4076,11 @@ }, { "name":"{{SUPERSET_ROLES_MAPPING.instructor}}", - "permissions": {{ permission_student_intructor_list()|tojson }} + "permissions": {% include "aspects/apps/superset/security/partials/read_only_permissions.json" | indent(4) %} }, { "name":"{{SUPERSET_ROLES_MAPPING.student}}", - "permissions": {{ permission_student_intructor_list()|tojson }} + "permissions": {% include "aspects/apps/superset/security/partials/read_only_permissions.json" | indent(4) %} } {% for role in SUPERSET_SUPPORTED_LANGUAGES %},{ From ca11c1051390878642f51c9a49d8eb6f8cd6b88d Mon Sep 17 00:00:00 2001 From: Fernando Date: Tue, 22 Aug 2023 16:55:03 -0400 Subject: [PATCH 5/7] fix: removing config.yml --- config.yml | 62 ------------------------------------------------------ 1 file changed, 62 deletions(-) delete mode 100644 config.yml diff --git a/config.yml b/config.yml deleted file mode 100644 index 1b50ef04..00000000 --- a/config.yml +++ /dev/null @@ -1,62 +0,0 @@ -CMS_OAUTH2_SECRET: mUDPC0mAIsrI55e6ewLCpOAF -ID: jV4UITdO51qynTEP6EWBEYIA -JWT_RSA_PRIVATE_KEY: '-----BEGIN RSA PRIVATE KEY----- - - MIIEogIBAAKCAQEAs24MJudBS4NvRqY3lXpz4XnaPWeCMie5iQbqT1oBV47BXlqq - - rqjCv6ajKNlW2cM2qpeDn1T/5CCFY1a0uBmft/GqHFjpiyh8gnvLP8fiqdM+YzGe - - RdyucbND0LTLNp14E4wEiK7s/lLUXe0mqsiFJCDumedHlm1e21AF+PZJ4xkpLL3d - - OUVke+8OOuOIOfGjXP5a6COUOTqPmPH51L2tP6/b/6vmSOYDja9GyUwJf8IJqDFx - - x/MbLqtkQJ22Ho7sxQbidHjY1LNnkzOOo5E1zOzK65Oayz+RDTAetvhP8FpbclN1 - - jLnyGxOakfnQ9npqukjzzmucrcSF3sC1S/nicQIDAQABAoIBAAWcjld8ocWEcKtZ - - WTFs9RkTBCTpuvAJ30L2cwdEibh0694BMKeZ+k4/XkixpGZW1Tu4VZra8A5QyI8q - - 5+e+kGjSr2bnznUGUP+NMtX1sMRuKXw1ce1eKZv/duJc9yKIAfh9h2pFaz7IdSET - - YMNUVlqjB4dLbQkatk3eVrN6s2SdaEKChKT4cOoknZVjd7y6d+iRNBlYxTQ4EuMH - - C0+JzHBxcUvtW8t2WRZAGkT46QDup8JNH/9STE0DJuPXhU+pvpXA90/b5cwm31Eo - - DKURa2wWk3916fkhkVxGJoiKkXLCweLqNjrFm+Nz8TZAb6x8gkbcG9CwUsXMWFk4 - - 2sEN3QkCgYEAxjUcCYjwmSTRPQJebcVwe9oT3Edg8XLPEGDtOzeBuNK8OUd+kRPi - - nc+YI3aLq0Q907rJLtiLQyT0TslB5M0zC7X8liDqPqvq3LViajKT+dyT496rL3Qd - - gWsUaplZAAAJjFHCwoiOUXTiJh/+2D0M4jtnyPmTDy3Q34hVHpAUC6kCgYEA579Q - - X0xWXrJ+Sl/HfPI5CcfQ6oE9OEBl1PtbRjcNNqPESKqjHi3sRN2eqyjDJm/kfECD - - F+3atMrxWMHjiNoyTZEOQWtfDs+BPlhwgm4jwG0vmK+mLun27KpFsb/3FnF3/nVw - - UPibJN1bqpjGWcwv4JkvfVKSlPKMmpKo2wzxnYkCgYAt4GMR7elKeRQZG/BBVh63 - - +/z20mqk2B8HOngOacWTwusgEuU/rSuZvVAIfUrMpGnvFN+2ARcSvn3xsnGXBMvY - - 3RGOqiWtxdsBpNYXoIdRoPV2G7bhr+2YY/GAzuejsV6EZPRAVJ0kS3qAuo0g/dh6 - - kKdwBBw+uisLYiHZhh2tqQKBgBv3nZZymvXAqrcFCgkNHk8M2yyBvkaclu12DBTU - - LfcLGnP+i8LnndzNtglH2Q05caSBEJEBtmQdHbUtaO0qD+oGeGbysz0RU7KXb7R9 - - 4DintJfDktWUjKURA2opFYOS2/1MZOqQpgBz6k0TNNS/bIO5WN7R6TiqcMdyrYgJ - - 7tqpAoGAZRrwIiVB26uqqTsalF/bnIU2e6ir9UmqR+BAljm2sKLzUcU1PH8H+j1p - - DnD91xqkUbXBiYPnGgvCetk+vazoTeOjJjA3USlO4h+b44tnL5YqHc3c73f2bol5 - - hMoSDyn5uIPeWlQrbSLoi+W/e+45CiGAmM2IK6urIcq5gpjQS44= - - -----END RSA PRIVATE KEY-----' -MYSQL_ROOT_PASSWORD: LIYV7fuy -OPENEDX_MYSQL_PASSWORD: nZERSPxK -OPENEDX_SECRET_KEY: PHI9tC5jFehfRxSBsSHTSpyv -PLUGINS: -- mfe -PLUGIN_INDEXES: -- https://overhang.io/tutor/main From bd79be8c576b338d4c9a6c5c0ef1e977c5a34c73 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Wed, 23 Aug 2023 09:33:02 -0500 Subject: [PATCH 6/7] fix: remove default role --- .../pythonpath/openedx_sso_security_manager.py | 12 +++++------- .../superset/pythonpath/superset_config_docker.py | 3 --- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py index 67198cee..aee22cd5 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py @@ -176,9 +176,11 @@ def _get_user_roles(self, username, language): roles = self.extra_get_user_roles(username, decoded_access_token) if roles: return roles - if not bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}"): + + if {{SUPERSET_BLOCK_STUDENT_ACCESS}}: + raise Exception(f"Student {username} tried to access Superset") + else: return ["student", f"student - {language}"] - raise Exception(f"Student {username} tried to access Superset") def extra_get_user_roles(self, username, decoded_access_token): """ @@ -224,8 +226,4 @@ def get_courses(self, username, permission="staff", next_url=None): for course_id in next_courses: courses.append(course_id) - # If the user has no staff access to any courses, they are a student - if not courses and bool("{{SUPERSET_BLOCK_STUDENT_ACCESS}}"): - raise Exception(f"User {username} is not an instructor") - else: - return courses + return courses diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py index 467939a0..d3e3d90e 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py @@ -48,9 +48,6 @@ # Will allow user self registration, allowing to create Flask users from Authorized User AUTH_USER_REGISTRATION = True -# The default user self registration role -AUTH_USER_REGISTRATION_ROLE = "{{SUPERSET_ROLES_MAPPING.instructor}}" - # Should we replace ALL the user's roles each login, or only on registration? AUTH_ROLES_SYNC_AT_LOGIN = True From ab56715c84115c6e897b298886fa80bfa9550f4f Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 24 Aug 2023 16:45:19 -0400 Subject: [PATCH 7/7] fix: Add check to prevent student role access when SUPERSET_BLOCK_STUDENT_ACCESS is True. --- .../apps/superset/pythonpath/openedx_sso_security_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py index aee22cd5..0c24ff99 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_sso_security_manager.py @@ -175,12 +175,14 @@ def _get_user_roles(self, username, language): else: roles = self.extra_get_user_roles(username, decoded_access_token) if roles: + if {{SUPERSET_BLOCK_STUDENT_ACCESS}} and 'student' in roles: + raise Exception(f"Student access not allowed for {username} due to SUPERSET_BLOCK_STUDENT_ACCESS setting.") return roles if {{SUPERSET_BLOCK_STUDENT_ACCESS}}: raise Exception(f"Student {username} tried to access Superset") else: - return ["student", f"student - {language}"] + return ["student", f"student-{language}"] def extra_get_user_roles(self, username, decoded_access_token): """