gergo/web 3616 add auth policy for turning on the exclusive workspace (#4956)

* feat(shared): rename user workspaces loader

* feat(gatekeeper): intoduce the enterprise plan

* chore(server): remove more "magic strings"

* refactor(shared): extract user is workspace admin to an auth fragment

* feat(shared): add can createWorkspacePolicy

* feat(workspaces): WIP block workspace creation

* feat(server): add can create workspace checks

* feat(workspaces): enforce canCreateWorkspace policy on the workspace
creation mutation

* feat(shared): allow workspace admins and guests to create workspaces
even if they are part of an exclusive workspace

* test(shared): use test fake properly

* fix(server): eligble workspace typing fixes

* test(shared): fix more workspace fakes

* fix(workspacesCore): add missing loader

* fix(shared): use proper exhaustive switch cases, they stop bugs from
happening

* feat(shared): introduce workspacePlanHasAccessToFeature function with tests

* chore(workspaces): fix more PR comments

* fix(workspaces): naming

* fix(workspaces): some more

* feat(shared): generalize workspace feature access policy

* feat(workspaces): allow toggling the isExclusive option for workspace
update
This commit is contained in:
Gergő Jedlicska
2025-06-18 12:43:27 +02:00
committed by GitHub
parent 325523f4a1
commit 794bd7c7e9
12 changed files with 111 additions and 65 deletions
@@ -20,7 +20,8 @@ export const WorkspacePlanFeatures = <const>{
DomainSecurity: 'domainBasedSecurityPolicies',
SSO: 'oidcSso',
CustomDataRegion: 'workspaceDataRegionSpecificity',
HideSpeckleBranding: 'hideSpeckleBranding'
HideSpeckleBranding: 'hideSpeckleBranding',
ExclusiveMembership: 'exclusiveMembership'
}
export type WorkspacePlanFeatures =
@@ -51,6 +52,11 @@ export const WorkspacePlanFeaturesMetadata = (<const>{
[WorkspacePlanFeatures.HideSpeckleBranding]: {
displayName: 'Customised viewer',
description: 'Hide the Speckle branding in embedded viewer'
},
[WorkspacePlanFeatures.ExclusiveMembership]: {
displayName: 'Exclusive workspace membership',
description:
'Members of exclusive workspaces cannot join or create other workspaces'
}
}) satisfies Record<
WorkspacePlanFeatures,
@@ -155,7 +161,8 @@ export const WorkspaceUnpaidPlanConfigs: {
WorkspacePlanFeatures.DomainSecurity,
WorkspacePlanFeatures.SSO,
WorkspacePlanFeatures.CustomDataRegion,
WorkspacePlanFeatures.HideSpeckleBranding
WorkspacePlanFeatures.HideSpeckleBranding,
WorkspacePlanFeatures.ExclusiveMembership
],
limits: unlimited
},
@@ -166,7 +173,8 @@ export const WorkspaceUnpaidPlanConfigs: {
WorkspacePlanFeatures.DomainSecurity,
WorkspacePlanFeatures.SSO,
WorkspacePlanFeatures.CustomDataRegion,
WorkspacePlanFeatures.HideSpeckleBranding
WorkspacePlanFeatures.HideSpeckleBranding,
WorkspacePlanFeatures.ExclusiveMembership
],
limits: unlimited
},