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