chore: enable vaults on free internal team user accounts (#2617)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
"build:snjs": "yarn workspaces foreach -p --topological-dev --verbose -R --from @standardnotes/snjs run build",
|
||||
"build:services": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/services run build",
|
||||
"build:api": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/api run build",
|
||||
"start:web": "yarn workspace @standardnotes/web start",
|
||||
"e2e": "lerna run start:test-server --scope=@standardnotes/snjs",
|
||||
"e2e:test": "yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html",
|
||||
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ComponentInterface, DecryptedItemInterface } from '@standardnotes/model
|
||||
import { FeatureStatus } from './FeatureStatus'
|
||||
import { SetOfflineFeaturesFunctionResponse } from './SetOfflineFeaturesFunctionResponse'
|
||||
import { NativeFeatureIdentifier } from '@standardnotes/features'
|
||||
import { Uuid } from '@standardnotes/domain-core'
|
||||
import { RoleName, Uuid } from '@standardnotes/domain-core'
|
||||
|
||||
export interface FeaturesClientInterface {
|
||||
getFeatureStatus(
|
||||
@@ -11,7 +11,7 @@ export interface FeaturesClientInterface {
|
||||
options?: { inContextOfItem?: DecryptedItemInterface },
|
||||
): FeatureStatus
|
||||
hasMinimumRole(role: string): boolean
|
||||
|
||||
hasRole(roleName: RoleName): boolean
|
||||
hasFirstPartyOfflineSubscription(): boolean
|
||||
setOfflineFeaturesCode(code: string): Promise<SetOfflineFeaturesFunctionResponse>
|
||||
hasOfflineRepo(): boolean
|
||||
|
||||
@@ -412,6 +412,10 @@ export class FeaturesService
|
||||
return Object.values(RoleName.NAMES).filter((role) => roles.includes(role))
|
||||
}
|
||||
|
||||
hasRole(roleName: RoleName): boolean {
|
||||
return this.onlineRoles.includes(roleName.value) || this.offlineRoles.includes(roleName.value)
|
||||
}
|
||||
|
||||
public hasMinimumRole(role: string): boolean {
|
||||
const sortedAllRoles = Object.values(RoleName.NAMES)
|
||||
|
||||
|
||||
@@ -133,7 +133,11 @@ export class FeaturesController extends AbstractViewController implements Intern
|
||||
|
||||
isVaultsEnabled(): boolean {
|
||||
const enabled = this.features.isExperimentalFeatureEnabled(NativeFeatureIdentifier.TYPES.Vaults)
|
||||
return featureTrunkVaultsEnabled() || enabled || this.features.hasMinimumRole(RoleName.NAMES.InternalTeamUser)
|
||||
return (
|
||||
featureTrunkVaultsEnabled() ||
|
||||
enabled ||
|
||||
this.features.hasRole(RoleName.create(RoleName.NAMES.InternalTeamUser).getValue())
|
||||
)
|
||||
}
|
||||
|
||||
isEntitledToSharedVaults(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user