Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add license check for ldap group maps

Tuan Dang1c95b3abe7ad
diff --git a/backend/src/ee/services/ldap-config/ldap-config-service.ts b/backend/src/ee/services/ldap-config/ldap-config-service.ts
index e90f8c0318..62d728ac0a 100644
--- a/backend/src/ee/services/ldap-config/ldap-config-service.ts
+++ b/backend/src/ee/services/ldap-config/ldap-config-service.ts
@@ -588,6 +588,12 @@ export const ldapConfigServiceFactory = ({
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Ldap);
+ const plan = await licenseService.getPlan(orgId);
+ if (!plan.ldap)
+ throw new BadRequestError({
+ message: "Failed to create LDAP group map due to plan restriction. Upgrade plan to create LDAP group map."
+ });
+
const ldapConfig = await ldapConfigDAL.findOne({
id: ldapConfigId,
orgId
@@ -618,6 +624,12 @@ export const ldapConfigServiceFactory = ({
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Delete, OrgPermissionSubjects.Ldap);
+ const plan = await licenseService.getPlan(orgId);
+ if (!plan.ldap)
+ throw new BadRequestError({
+ message: "Failed to delete LDAP group map due to plan restriction. Upgrade plan to delete LDAP group map."
+ });
+
const ldapConfig = await ldapConfigDAL.findOne({
id: ldapConfigId,
orgId