Skip to content

Commit

Permalink
rename config variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurnewase committed Dec 25, 2022
1 parent 7524acb commit 3bfcb81
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ assists people when migrating to a new version.

- [22328](https://github.com/apache/superset/pull/22328): For deployments that have enabled the "THUMBNAILS" feature flag, the function that calculates dashboard digests has been updated to consider additional properties to more accurately identify changes in the dashboard metadata. This change will invalidate all currently cached dashboard thumbnails.
- [21765](https://github.com/apache/superset/pull/21765): For deployments that have enabled the "ALERT_REPORTS" feature flag, Gamma users will no longer have read and write access to Alerts & Reports by default. To give Gamma users the ability to schedule reports from the Dashboard and Explore view like before, create an additional role with "can read on ReportSchedule" and "can write on ReportSchedule" permissions. To further give Gamma users access to the "Alerts & Reports" menu and CRUD view, add "menu access on Manage" and "menu access on Alerts & Report" permissions to the role.
- [22325] (https://github.com/apache/superset/pull/22325): "RLS_FORM_QUERY_REL_FIELDS" is replaced by "RLS_FILTER_RELATED_FIELDS" feature flag.Its value format stays same.
- [22325](https://github.com/apache/superset/pull/22325): "RLS_FORM_QUERY_REL_FIELDS" is replaced by "RLS_BASE_RELATED_FIELD_FILTERS" feature flag.Its value format stays same.

### Potential Downtime

Expand Down
4 changes: 2 additions & 2 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,11 +1332,11 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
#
# from flask_appbuilder.models.sqla import filters

# RLS_FILTER_RELATED_FIELDS = {
# RLS_BASE_RELATED_FIELD_FILTERS = {
# "tables": [["table_name", filters.FilterStartsWith, "birth"]],
# "roles": [["name", filters.FilterContains, "Admin"]]
# }
RLS_FILTER_RELATED_FIELDS: Dict[str, BaseFilter] = {}
RLS_BASE_RELATED_FIELD_FILTERS: Dict[str, BaseFilter] = {}

#
# Flask session cookie options
Expand Down
2 changes: 1 addition & 1 deletion superset/row_level_security/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class RLSRestApi(BaseSupersetModelRestApi):
edit_model_schema = RLSPutSchema()

allowed_rel_fields = {"tables", "roles"}
filter_rel_fields = app.config["RLS_FILTER_RELATED_FIELDS"]
base_related_field_filters = app.config["RLS_BASE_RELATED_FIELD_FILTERS"]

@expose("/", methods=["POST"])
@protect()
Expand Down
6 changes: 3 additions & 3 deletions tests/integration_tests/security/row_level_security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def test_rls_roles_related_api(self):
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@pytest.mark.usefixtures("load_energy_table_with_slice")
@mock.patch(
"superset.row_level_security.api.RLSRestApi.filter_rel_fields",
"superset.row_level_security.api.RLSRestApi.base_related_field_filters",
{"tables": [["table_name", filters.FilterStartsWith, "birth"]]},
)
def test_table_related_filter(self):
Expand All @@ -588,7 +588,7 @@ def test_table_related_filter(self):
assert {"birth_names"} == received_tables

@mock.patch(
"superset.row_level_security.api.RLSRestApi.filter_rel_fields",
"superset.row_level_security.api.RLSRestApi.base_related_field_filters",
{"roles": [["name", filters.FilterEqual, "Admin"]]},
)
def test_role_related_filter(self):
Expand All @@ -609,7 +609,7 @@ def test_role_related_filter(self):
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@pytest.mark.usefixtures("load_energy_table_with_slice")
@mock.patch(
"superset.row_level_security.api.RLSRestApi.filter_rel_fields",
"superset.row_level_security.api.RLSRestApi.base_related_field_filters",
{
"tables": [["table_name", filters.FilterStartsWith, "birth"]],
"roles": [["name", filters.FilterEqual, "Admin"]],
Expand Down

0 comments on commit 3bfcb81

Please sign in to comment.