chore: change u2f from feature trunk to role based permission restricted (#2250)

This commit is contained in:
Karol Sójko
2023-03-08 13:15:16 +01:00
committed by GitHub
parent 896834f65a
commit 5bd7e785c8
2 changed files with 6 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
import { FeatureIdentifier, FeatureStatus } from '@standardnotes/snjs'
import { WebApplication } from '@/Application/Application'
import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { FunctionComponent } from 'react'
@@ -12,7 +14,6 @@ import PreferencesPane from '@/Components/Preferences/PreferencesComponents/Pref
import BiometricsLock from '@/Components/Preferences/Panes/Security/BiometricsLock'
import MultitaskingPrivacy from '@/Components/Preferences/Panes/Security/MultitaskingPrivacy'
import U2FWrapper from './U2F/U2FWrapper'
import { featureTrunkEnabled, FeatureTrunkName } from '@/FeatureTrunk'
interface SecurityProps extends MfaProps {
viewControllerManager: ViewControllerManager
@@ -22,6 +23,9 @@ interface SecurityProps extends MfaProps {
const Security: FunctionComponent<SecurityProps> = (props) => {
const isNativeMobileWeb = props.application.isNativeMobileWeb()
const isU2FFeatureAvailable =
props.application.features.getFeatureStatus(FeatureIdentifier.UniversalSecondFactor) === FeatureStatus.Entitled
return (
<PreferencesPane>
<Encryption viewControllerManager={props.viewControllerManager} />
@@ -34,9 +38,7 @@ const Security: FunctionComponent<SecurityProps> = (props) => {
userProvider={props.userProvider}
application={props.application}
/>
{featureTrunkEnabled(FeatureTrunkName.U2F) && (
<U2FWrapper userProvider={props.userProvider} application={props.application} />
)}
{isU2FFeatureAvailable && <U2FWrapper userProvider={props.userProvider} application={props.application} />}
{isNativeMobileWeb && <MultitaskingPrivacy application={props.application} />}
<PasscodeLock viewControllerManager={props.viewControllerManager} application={props.application} />
{isNativeMobileWeb && <BiometricsLock application={props.application} />}

View File

@@ -3,13 +3,11 @@ import { isDev } from '@/Utils'
export enum FeatureTrunkName {
Super,
ImportTools,
U2F,
}
const FeatureTrunkStatus: Record<FeatureTrunkName, boolean> = {
[FeatureTrunkName.Super]: isDev && true,
[FeatureTrunkName.ImportTools]: isDev && true,
[FeatureTrunkName.U2F]: isDev && true,
}
export function featureTrunkEnabled(trunk: FeatureTrunkName): boolean {