-
Notifications
You must be signed in to change notification settings - Fork 16.6k
feat(embedded): add feature flag to disable logout button in embedded contexts #37537
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,12 @@ import { Link } from 'react-router-dom'; | |
| import { useQueryParams, BooleanParam } from 'use-query-params'; | ||
| import { isEmpty } from 'lodash'; | ||
| import { t } from '@apache-superset/core'; | ||
| import { SupersetClient, getExtensionsRegistry } from '@superset-ui/core'; | ||
| import { | ||
| SupersetClient, | ||
| getExtensionsRegistry, | ||
| isFeatureEnabled, | ||
| FeatureFlag, | ||
| } from '@superset-ui/core'; | ||
| import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; | ||
| import { | ||
| Tag, | ||
|
|
@@ -489,15 +494,19 @@ const RightMenu = ({ | |
| ), | ||
| }); | ||
| } | ||
| userItems.push({ | ||
| key: 'logout', | ||
| label: ( | ||
| <Typography.Link href={navbarRight.user_logout_url}> | ||
| {t('Logout')} | ||
| </Typography.Link> | ||
| ), | ||
| onClick: handleLogout, | ||
| }); | ||
| if (!isFeatureEnabled(FeatureFlag.DisableEmbeddedSupersetLogout)) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't more aligned with our existing patterns to use a permission for hide/show a menu? Was there any reason why that wouldn't work on embedded envs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question! The feature flag is actually the right approach here — permissions are per-role (RBAC), but hiding logout in an embedded deployment is a system-wide concern, not a per-user one. There's no existing can_logout permission in FAB, and creating one would conflate authorization with deployment topology. There's also direct precedent for this: |
||
| userItems.push({ | ||
| key: 'logout', | ||
| label: ( | ||
| <Typography.Link | ||
| href={ensureAppRoot(navbarRight.user_logout_url)} | ||
| > | ||
| {t('Logout')} | ||
| </Typography.Link> | ||
| ), | ||
| onClick: handleLogout, | ||
| }); | ||
| } | ||
|
|
||
| items.push({ | ||
| type: 'group', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.