|
8 | 8 | "net/http"
|
9 | 9 | "os"
|
10 | 10 | "path/filepath"
|
| 11 | +"slices" |
11 | 12 | "strconv"
|
12 | 13 | "strings"
|
13 | 14 | "time"
|
@@ -143,26 +144,23 @@ const (
|
143 | 144 | func (setFeatureSet)Features() []FeatureName {
|
144 | 145 | switchFeatureSet(strings.ToLower(string(set))) {
|
145 | 146 | caseFeatureSetEnterprise:
|
146 |
| -// List all features that should be included in the Enterprise feature set. |
147 |
| -return []FeatureName{ |
148 |
| -FeatureUserLimit, |
149 |
| -FeatureAuditLog, |
150 |
| -FeatureBrowserOnly, |
151 |
| -FeatureSCIM, |
152 |
| -FeatureTemplateRBAC, |
153 |
| -FeatureHighAvailability, |
154 |
| -FeatureMultipleExternalAuth, |
155 |
| -FeatureExternalProvisionerDaemons, |
156 |
| -FeatureAppearance, |
157 |
| -FeatureAdvancedTemplateScheduling, |
158 |
| -FeatureWorkspaceProxy, |
159 |
| -FeatureUserRoleManagement, |
160 |
| -FeatureExternalTokenEncryption, |
161 |
| -FeatureWorkspaceBatchActions, |
162 |
| -FeatureAccessControl, |
163 |
| -FeatureControlSharedPorts, |
164 |
| -FeatureCustomRoles, |
165 |
| -} |
| 147 | +// Enterprise is the set 'AllFeatures' minus some select features. |
| 148 | + |
| 149 | +// Copy the list of all features |
| 150 | +enterpriseFeatures:=make([]FeatureName,len(FeatureNames)) |
| 151 | +copy(enterpriseFeatures,FeatureNames) |
| 152 | +// Remove the selection |
| 153 | +enterpriseFeatures=slices.DeleteFunc(enterpriseFeatures,func(fFeatureName)bool { |
| 154 | +switchf { |
| 155 | +// Add all features that should be excluded in the Enterprise feature set. |
| 156 | +caseFeatureMultipleOrganizations: |
| 157 | +returntrue |
| 158 | +default: |
| 159 | +returnfalse |
| 160 | +} |
| 161 | +}) |
| 162 | + |
| 163 | +returnenterpriseFeatures |
166 | 164 | caseFeatureSetPremium:
|
167 | 165 | // FeatureSetPremium is a superset of Enterprise
|
168 | 166 | returnappend(FeatureSetEnterprise.Features(),FeatureMultipleOrganizations)
|
|