mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-08 16:43:37 +00:00
Properly paywall the new resource types
This commit is contained in:
@@ -293,7 +293,7 @@ export async function createSiteResource(
|
||||
if (mode == "http") {
|
||||
const hasHttpFeature = await isLicensedOrSubscribed(
|
||||
orgId,
|
||||
tierMatrix[TierFeature.HTTPPrivateResources]
|
||||
tierMatrix[TierFeature.AdvancedPrivateResources]
|
||||
);
|
||||
if (!hasHttpFeature) {
|
||||
return next(
|
||||
@@ -425,9 +425,18 @@ export async function createSiteResource(
|
||||
|
||||
const isLicensedSshPam = await isLicensedOrSubscribed(
|
||||
orgId,
|
||||
tierMatrix.sshPam
|
||||
tierMatrix.advancedPrivateResources
|
||||
);
|
||||
|
||||
if (mode == "ssh" && !isLicensedSshPam) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.FORBIDDEN,
|
||||
"SSH private resources are not included in your current plan. Please upgrade."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let updatedNiceId = niceId;
|
||||
if (!niceId) {
|
||||
updatedNiceId = await getUniqueSiteResourceName(orgId);
|
||||
|
||||
@@ -314,7 +314,7 @@ export async function updateSiteResource(
|
||||
if (mode == "http") {
|
||||
const hasHttpFeature = await isLicensedOrSubscribed(
|
||||
existingSiteResource.orgId,
|
||||
tierMatrix[TierFeature.HTTPPrivateResources]
|
||||
tierMatrix[TierFeature.AdvancedPrivateResources]
|
||||
);
|
||||
if (!hasHttpFeature) {
|
||||
return next(
|
||||
@@ -328,7 +328,7 @@ export async function updateSiteResource(
|
||||
|
||||
const isLicensedSshPam = await isLicensedOrSubscribed(
|
||||
existingSiteResource.orgId,
|
||||
tierMatrix.sshPam
|
||||
tierMatrix.advancedPrivateResources
|
||||
);
|
||||
|
||||
const [org] = await db
|
||||
|
||||
Reference in New Issue
Block a user