Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check embedded feature flag in request loader #18628

Merged
merged 3 commits into from
Feb 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,15 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
guest_user_cls = GuestUser

def create_login_manager(self, app: Flask) -> LoginManager:
# pylint: disable=import-outside-toplevel
lm = super().create_login_manager(app)
lm.request_loader(self.request_loader)
return lm

def request_loader(self, request: Request):
from superset.extensions import feature_flag_manager

lm = super().create_login_manager(app)
if feature_flag_manager.is_feature_enabled("EMBEDDED_SUPERSET"):
lm.request_loader(self.get_guest_user_from_request)
return lm
return self.get_guest_user_from_request(request)

def get_schema_perm( # pylint: disable=no-self-use
self, database: Union["Database", str], schema: Optional[str] = None
Expand Down