mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(RLS): RESTful apis and react view for RLS (#22325)
This commit is contained in:
@@ -123,7 +123,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
from superset.charts.api import ChartRestApi
|
||||
from superset.charts.data.api import ChartDataRestApi
|
||||
from superset.connectors.sqla.views import (
|
||||
RowLevelSecurityFiltersModelView,
|
||||
RowLevelSecurityView,
|
||||
SqlMetricInlineView,
|
||||
TableColumnInlineView,
|
||||
TableModelView,
|
||||
@@ -147,6 +147,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
from superset.queries.saved_queries.api import SavedQueryRestApi
|
||||
from superset.reports.api import ReportScheduleRestApi
|
||||
from superset.reports.logs.api import ReportExecutionLogRestApi
|
||||
from superset.row_level_security.api import RLSRestApi
|
||||
from superset.security.api import SecurityRestApi
|
||||
from superset.views.access_requests import AccessRequestsModelView
|
||||
from superset.views.alerts import AlertView, ReportView
|
||||
@@ -215,6 +216,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
appbuilder.add_api(QueryRestApi)
|
||||
appbuilder.add_api(ReportScheduleRestApi)
|
||||
appbuilder.add_api(ReportExecutionLogRestApi)
|
||||
appbuilder.add_api(RLSRestApi)
|
||||
appbuilder.add_api(SavedQueryRestApi)
|
||||
#
|
||||
# Setup regular views
|
||||
@@ -280,14 +282,6 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
category_label=__("Manage"),
|
||||
category_icon="",
|
||||
)
|
||||
appbuilder.add_view(
|
||||
RowLevelSecurityFiltersModelView,
|
||||
"Row Level Security",
|
||||
label=__("Row Level Security"),
|
||||
category="Security",
|
||||
category_label=__("Security"),
|
||||
icon="fa-lock",
|
||||
)
|
||||
|
||||
#
|
||||
# Setup views with no menu
|
||||
@@ -409,6 +403,16 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
menu_cond=lambda: bool(self.config["ENABLE_ACCESS_REQUEST"]),
|
||||
)
|
||||
|
||||
appbuilder.add_view(
|
||||
RowLevelSecurityView,
|
||||
"Row Level Security",
|
||||
href="/rowlevelsecurity/list/",
|
||||
label=__("Row Level Security"),
|
||||
category="Security",
|
||||
category_label=__("Security"),
|
||||
icon="fa-lock",
|
||||
)
|
||||
|
||||
def init_app_in_ctx(self) -> None:
|
||||
"""
|
||||
Runs init logic in the context of the app
|
||||
|
||||
Reference in New Issue
Block a user