diff --git a/packages/builder/src/components/common/RoleSelect.svelte b/packages/builder/src/components/common/RoleSelect.svelte index 49b349a00c..6eb7b705be 100644 --- a/packages/builder/src/components/common/RoleSelect.svelte +++ b/packages/builder/src/components/common/RoleSelect.svelte @@ -24,6 +24,7 @@ const dispatch = createEventDispatcher() const RemoveID = "remove" + const subType = $licensing.license.plan.type $: enrichLabel = label => (labelPrefix ? `${labelPrefix} ${label}` : label) $: options = getOptions( @@ -68,13 +69,19 @@ })) // Add creator if required - if (allowCreator) { + if ( + allowCreator || + subType === Constants.PlanType.ENTERPRISE || + subType === Constants.PlanType.ENTERPRISE_BASIC + ) { options.unshift({ _id: Constants.Roles.CREATOR, name: "Can edit", tag: - !$licensing.perAppBuildersEnabled && - capitalise(Constants.PlanType.ENTERPRISE), + subType === Constants.PlanType.ENTERPRISE || + subType === Constants.PlanType.ENTERPRISE_BASIC + ? null + : capitalise(Constants.PlanType.ENTERPRISE), }) } @@ -134,9 +141,16 @@ getOptionValue={role => role._id} getOptionColour={getColor} getOptionIcon={getIcon} - isOptionEnabled={option => - option._id !== Constants.Roles.CREATOR || - $licensing.perAppBuildersEnabled} + isOptionEnabled={option => { + if (option._id === Constants.Roles.CREATOR) { + return ( + subType === Constants.PlanType.ENTERPRISE || + (subType === Constants.PlanType.ENTERPRISE_BASIC_TRIAL && + $licensing.perAppBuildersEnabled) + ) + } + return true + }} {placeholder} {error} /> @@ -154,10 +168,16 @@ getOptionValue={role => role._id} getOptionColour={getColor} getOptionIcon={getIcon} - isOptionEnabled={option => - (option._id !== Constants.Roles.CREATOR || - $licensing.perAppBuildersEnabled) && - option.enabled !== false} + isOptionEnabled={option => { + if (option._id === Constants.Roles.CREATOR) { + return ( + subType === Constants.PlanType.ENTERPRISE || + (subType === Constants.PlanType.ENTERPRISE_BASIC_TRIAL && + $licensing.perAppBuildersEnabled) + ) + } + return option.enabled !== false + }} {placeholder} {error} />