mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 17:27:16 +00:00
fix: unlimited users and identities only for enterprise and remove frontend check
This commit is contained in:
@@ -58,7 +58,8 @@ export const identityServiceFactory = ({
|
|||||||
if (!hasRequiredPriviledges) throw new BadRequestError({ message: "Failed to create a more privileged identity" });
|
if (!hasRequiredPriviledges) throw new BadRequestError({ message: "Failed to create a more privileged identity" });
|
||||||
|
|
||||||
const plan = await licenseService.getPlan(orgId);
|
const plan = await licenseService.getPlan(orgId);
|
||||||
if (plan?.identityLimit && plan.identitiesUsed >= plan.identityLimit) {
|
|
||||||
|
if (plan?.slug !== "enterprise" && plan?.identityLimit && plan.identitiesUsed >= plan.identityLimit) {
|
||||||
// limit imposed on number of identities allowed / number of identities used exceeds the number of identities allowed
|
// limit imposed on number of identities allowed / number of identities used exceeds the number of identities allowed
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Failed to create identity due to identity limit reached. Upgrade plan to create more identities."
|
message: "Failed to create identity due to identity limit reached. Upgrade plan to create more identities."
|
||||||
|
|||||||
@@ -476,19 +476,20 @@ export const orgServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const plan = await licenseService.getPlan(orgId);
|
const plan = await licenseService.getPlan(orgId);
|
||||||
if (plan?.memberLimit && plan.membersUsed >= plan.memberLimit) {
|
if (plan?.slug !== "enterprise" && plan?.memberLimit && plan.membersUsed >= plan.memberLimit) {
|
||||||
// limit imposed on number of members allowed / number of members used exceeds the number of members allowed
|
// limit imposed on number of members allowed / number of members used exceeds the number of members allowed
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Failed to invite member due to member limit reached. Upgrade plan to invite more members."
|
message: "Failed to invite member due to member limit reached. Upgrade plan to invite more members."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plan?.identityLimit && plan.identitiesUsed >= plan.identityLimit) {
|
if (plan?.slug !== "enterprise" && plan?.identityLimit && plan.identitiesUsed >= plan.identityLimit) {
|
||||||
// limit imposed on number of identities allowed / number of identities used exceeds the number of identities allowed
|
// limit imposed on number of identities allowed / number of identities used exceeds the number of identities allowed
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Failed to invite member due to member limit reached. Upgrade plan to invite more members."
|
message: "Failed to invite member due to member limit reached. Upgrade plan to invite more members."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const isCustomOrgRole = !Object.values(OrgMembershipRole).includes(organizationRoleSlug as OrgMembershipRole);
|
const isCustomOrgRole = !Object.values(OrgMembershipRole).includes(organizationRoleSlug as OrgMembershipRole);
|
||||||
if (isCustomOrgRole) {
|
if (isCustomOrgRole) {
|
||||||
if (!plan?.rbac)
|
if (!plan?.rbac)
|
||||||
|
|||||||
+3
-1
@@ -42,6 +42,8 @@ export const IdentitySection = withPermission(
|
|||||||
? subscription.identitiesUsed < subscription.identityLimit
|
? subscription.identitiesUsed < subscription.identityLimit
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
|
const isEnterprise = subscription?.slug === "enterprise"
|
||||||
|
|
||||||
const onDeleteIdentitySubmit = async (identityId: string) => {
|
const onDeleteIdentitySubmit = async (identityId: string) => {
|
||||||
try {
|
try {
|
||||||
await deleteMutateAsync({
|
await deleteMutateAsync({
|
||||||
@@ -93,7 +95,7 @@ export const IdentitySection = withPermission(
|
|||||||
type="submit"
|
type="submit"
|
||||||
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!isMoreIdentitiesAllowed) {
|
if (!isMoreIdentitiesAllowed && !isEnterprise) {
|
||||||
handlePopUpOpen("upgradePlan", {
|
handlePopUpOpen("upgradePlan", {
|
||||||
description: "You can add more identities if you upgrade your Infisical plan."
|
description: "You can add more identities if you upgrade your Infisical plan."
|
||||||
});
|
});
|
||||||
|
|||||||
+3
-1
@@ -51,6 +51,8 @@ export const OrgMembersSection = () => {
|
|||||||
? subscription.identitiesUsed < subscription.identityLimit
|
? subscription.identitiesUsed < subscription.identityLimit
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
|
const isEnterprise = subscription?.slug === "enterprise";
|
||||||
|
|
||||||
const handleAddMemberModal = () => {
|
const handleAddMemberModal = () => {
|
||||||
if (currentOrg?.authEnforced) {
|
if (currentOrg?.authEnforced) {
|
||||||
createNotification({
|
createNotification({
|
||||||
@@ -60,7 +62,7 @@ export const OrgMembersSection = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMoreUsersAllowed || !isMoreIdentitiesAllowed) {
|
if ((!isMoreUsersAllowed || !isMoreIdentitiesAllowed) && !isEnterprise) {
|
||||||
handlePopUpOpen("upgradePlan", {
|
handlePopUpOpen("upgradePlan", {
|
||||||
description: "You can add more members if you upgrade your Infisical plan."
|
description: "You can add more members if you upgrade your Infisical plan."
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user