mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(superset-frontend): Fixes for broken functionality when an application root is defined (#36058)
This commit is contained in:
@@ -44,7 +44,6 @@ from flask_appbuilder.security.views import (
|
||||
PermissionViewModelView,
|
||||
ViewMenuModelView,
|
||||
)
|
||||
from flask_appbuilder.widgets import ListWidget
|
||||
from flask_babel import lazy_gettext as _
|
||||
from flask_login import AnonymousUserMixin, LoginManager
|
||||
from jwt.api_jwt import _jwt_global_obj
|
||||
@@ -111,27 +110,6 @@ class DatabaseCatalogSchema(NamedTuple):
|
||||
schema: str
|
||||
|
||||
|
||||
class SupersetSecurityListWidget(ListWidget): # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
Redeclaring to avoid circular imports
|
||||
"""
|
||||
|
||||
template = "superset/fab_overrides/list.html"
|
||||
|
||||
|
||||
class SupersetRoleListWidget(ListWidget): # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
Role model view from FAB already uses a custom list widget override
|
||||
So we override the override
|
||||
"""
|
||||
|
||||
template = "superset/fab_overrides/list_role.html"
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
kwargs["appbuilder"] = current_app.appbuilder
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class SupersetRoleApi(RoleApi):
|
||||
"""
|
||||
Overriding the RoleApi to be able to delete roles with permissions
|
||||
@@ -196,9 +174,6 @@ class SupersetUserApi(UserApi):
|
||||
item.roles = []
|
||||
|
||||
|
||||
PermissionViewModelView.list_widget = SupersetSecurityListWidget
|
||||
PermissionModelView.list_widget = SupersetSecurityListWidget
|
||||
|
||||
# Limiting routes on FAB model views
|
||||
PermissionViewModelView.include_route_methods = {RouteMethod.LIST}
|
||||
PermissionModelView.include_route_methods = {RouteMethod.LIST}
|
||||
|
||||
Reference in New Issue
Block a user