diff --git a/frontend/packages/console-shared/src/constants/common.ts b/frontend/packages/console-shared/src/constants/common.ts index 0cd24015eda..7733ae3a13d 100644 --- a/frontend/packages/console-shared/src/constants/common.ts +++ b/frontend/packages/console-shared/src/constants/common.ts @@ -94,6 +94,7 @@ export enum FLAGS { CONSOLE_CAPABILITY_GETTINGSTARTEDBANNER_IS_ENABLED = 'CONSOLE_CAPABILITY_GETTINGSTARTEDBANNER_IS_ENABLED', LIGHTSPEED_IS_AVAILABLE_TO_INSTALL = 'LIGHTSPEED_IS_AVAILABLE_TO_INSTALL', DEVCONSOLE_PROXY = 'DEVCONSOLE_PROXY', + IMPERSONATE = 'IMPERSONATE', } export const CONFIG_STORAGE_CONSOLE = 'console'; diff --git a/frontend/public/reducers/features.ts b/frontend/public/reducers/features.ts index 52ced286a60..390d0346529 100644 --- a/frontend/public/reducers/features.ts +++ b/frontend/public/reducers/features.ts @@ -40,6 +40,19 @@ export const defaults = _.mapValues(FLAGS, (flag) => { ); case FLAGS.DEVCONSOLE_PROXY: return true; + case FLAGS.IMPERSONATE: { + // FIXME: Check localStorage for override, default to false (disabled) + // This is the flag for the multi-group impersonation feature. + const localStorageValue = localStorage.getItem('bridge/impersonate-enabled'); + if (localStorageValue === 'true') { + // eslint-disable-next-line no-console + console.log('[Feature Flag] Impersonation enabled via localStorage'); + return true; + } + // eslint-disable-next-line no-console + console.log('[Feature Flag] Impersonation disabled (default or localStorage=false)'); + return false; + } default: return undefined; }