From 4fc9778f2122936fdddebea9ee63216b561b3286 Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Wed, 18 Feb 2026 12:42:05 -0500 Subject: [PATCH 1/4] docs: Update rls patch instructions Updated examples for applying row level security filters in Superset. Added instructions for overwriting and appending to existing SECURITY_FILTERS. From https://discuss.openedx.org/t/aspects-superset-row-level-security-patch/18459 --- .../how-tos/superset_row_level_security.rst | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/docs/technical_documentation/how-tos/superset_row_level_security.rst b/docs/technical_documentation/how-tos/superset_row_level_security.rst index 617674e..9eea339 100644 --- a/docs/technical_documentation/how-tos/superset_row_level_security.rst +++ b/docs/technical_documentation/how-tos/superset_row_level_security.rst @@ -4,19 +4,33 @@ Superset extra row level security ********************************* To apply custom row level security filters to Superset, you can use the patch -`superset-row-level-security`. This patch expects a list of python dictionaries -with the following structure: +`superset-row-level-security`. This patch can overwrite the `default list `_ of roles +or use ``append`` to add additional dictionaries. +Overwrite existing: .. code-block:: yaml + SECURITY_FILTERS = [ + { + "schema": "{{ASPECTS_XAPI_DATABASE}}", + "table_name": "{{ASPECTS_XAPI_TABLE}}", + "role_name": "{{SUPERSET_ROLES_MAPPING.instructor}}", + "group_key": "{{SUPERSET_ROW_LEVEL_SECURITY_XAPI_GROUP_KEY}}", + "clause": {% raw %}'{{can_view_courses(current_username(), "splitByChar(\'/\', course_id)[-1]")}}',{% endraw %} + "filter_type": "Regular", + }, + ] - superset-row-level-security: | - { - "schema": "{{ASPECTS_XAPI_DATABASE}}", - "table_name": "{{ASPECTS_XAPI_TABLE}}", - "role_name": "{{SUPERSET_ROLES_MAPPING.instructor}}", - "group_key": "{{SUPERSET_ROW_LEVEL_SECURITY_XAPI_GROUP_KEY}}", - "clause": {% raw %}'{{can_view_courses(current_username(), "splitByChar(\'/\', course_id)[-1]")}}',{% endraw %} - "filter_type": "Regular", - }, +Add to existing: +.. code-block:: yaml + SECURITY_FILTERS.append( + { + "schema": "{{ASPECTS_XAPI_DATABASE}}", + "table_name": "{{ASPECTS_XAPI_TABLE}}", + "role_name": "{{SUPERSET_ROLES_MAPPING.instructor}}", + "group_key": "{{SUPERSET_ROW_LEVEL_SECURITY_XAPI_GROUP_KEY}}", + "clause": {% raw %}'{{can_view_courses(current_username(), "splitByChar(\'/\', course_id)[-1]")}}',{% endraw %} + "filter_type": "Regular", + }, + ) You can find more information about Superset RLSF in the `Superset documentation `_. From c39d85ada7383e62fc6b39d33813b3ae3fb97a6d Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Wed, 18 Feb 2026 12:42:54 -0500 Subject: [PATCH 2/4] docs: rst typo --- .../how-tos/superset_row_level_security.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/technical_documentation/how-tos/superset_row_level_security.rst b/docs/technical_documentation/how-tos/superset_row_level_security.rst index 9eea339..f7e0a4e 100644 --- a/docs/technical_documentation/how-tos/superset_row_level_security.rst +++ b/docs/technical_documentation/how-tos/superset_row_level_security.rst @@ -9,6 +9,7 @@ or use ``append`` to add additional dictionaries. Overwrite existing: .. code-block:: yaml + SECURITY_FILTERS = [ { "schema": "{{ASPECTS_XAPI_DATABASE}}", @@ -22,6 +23,7 @@ Overwrite existing: Add to existing: .. code-block:: yaml + SECURITY_FILTERS.append( { "schema": "{{ASPECTS_XAPI_DATABASE}}", From 6e6d7a389e65ed7418898db235fb7b7e4e4269de Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Wed, 18 Feb 2026 12:45:34 -0500 Subject: [PATCH 3/4] docs: rst typo --- .../how-tos/superset_row_level_security.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/technical_documentation/how-tos/superset_row_level_security.rst b/docs/technical_documentation/how-tos/superset_row_level_security.rst index f7e0a4e..2bd9720 100644 --- a/docs/technical_documentation/how-tos/superset_row_level_security.rst +++ b/docs/technical_documentation/how-tos/superset_row_level_security.rst @@ -4,10 +4,11 @@ Superset extra row level security ********************************* To apply custom row level security filters to Superset, you can use the patch -`superset-row-level-security`. This patch can overwrite the `default list `_ of roles +``superset-row-level-security``. This patch can overwrite the `default list `_ of roles or use ``append`` to add additional dictionaries. Overwrite existing: + .. code-block:: yaml SECURITY_FILTERS = [ @@ -22,6 +23,7 @@ Overwrite existing: ] Add to existing: + .. code-block:: yaml SECURITY_FILTERS.append( From 4bf9e01347323f15eb8b79da2c6b37685eaf271a Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Wed, 18 Feb 2026 12:47:27 -0500 Subject: [PATCH 4/4] docs: rst typo --- .../how-tos/superset_row_level_security.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/technical_documentation/how-tos/superset_row_level_security.rst b/docs/technical_documentation/how-tos/superset_row_level_security.rst index 2bd9720..93f8c1b 100644 --- a/docs/technical_documentation/how-tos/superset_row_level_security.rst +++ b/docs/technical_documentation/how-tos/superset_row_level_security.rst @@ -9,7 +9,7 @@ or use ``append`` to add additional dictionaries. Overwrite existing: -.. code-block:: yaml +.. code-block:: SECURITY_FILTERS = [ { @@ -24,7 +24,7 @@ Overwrite existing: Add to existing: -.. code-block:: yaml +.. code-block:: SECURITY_FILTERS.append( {