mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-04 11:30:38 -05:00
8b5328aa74
Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import "server-only";
|
|
|
|
import { ENTERPRISE_LICENSE_KEY, IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants";
|
|
import { TTeam } from "@formbricks/types/teams";
|
|
|
|
export const getIsEnterpriseEdition = (): boolean => {
|
|
if (ENTERPRISE_LICENSE_KEY) {
|
|
return ENTERPRISE_LICENSE_KEY.length > 0;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
export const getRemoveInAppBrandingPermission = (team: TTeam): boolean => {
|
|
if (IS_FORMBRICKS_CLOUD) return team.billing.features.inAppSurvey.status !== "inactive";
|
|
else if (!IS_FORMBRICKS_CLOUD) return true;
|
|
else return false;
|
|
};
|
|
|
|
export const getRemoveLinkBrandingPermission = (team: TTeam): boolean => {
|
|
if (IS_FORMBRICKS_CLOUD) return team.billing.features.linkSurvey.status !== "inactive";
|
|
else if (!IS_FORMBRICKS_CLOUD) return true;
|
|
else return false;
|
|
};
|
|
|
|
export const getRoleManagementPermission = (team: TTeam): boolean => {
|
|
if (IS_FORMBRICKS_CLOUD) return team.billing.features.inAppSurvey.status !== "inactive";
|
|
else if (!IS_FORMBRICKS_CLOUD) return getIsEnterpriseEdition();
|
|
else return false;
|
|
};
|
|
|
|
export const getAdvancedTargetingPermission = (team: TTeam): boolean => {
|
|
if (IS_FORMBRICKS_CLOUD) return team.billing.features.userTargeting.status !== "inactive";
|
|
else if (!IS_FORMBRICKS_CLOUD) return getIsEnterpriseEdition();
|
|
else return false;
|
|
};
|
|
|
|
export const getMultiLanguagePermission = (team: TTeam): boolean => {
|
|
if (IS_FORMBRICKS_CLOUD) return team.billing.features.inAppSurvey.status !== "inactive";
|
|
else if (!IS_FORMBRICKS_CLOUD) return getIsEnterpriseEdition();
|
|
else return false;
|
|
};
|