mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-21 16:25:19 +00:00
🛂 gate label endpoints behing subscription
This commit is contained in:
@@ -25,7 +25,7 @@ export function verifyValidSubscription(tiers: Tier[]) {
|
|||||||
next: NextFunction
|
next: NextFunction
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
try {
|
try {
|
||||||
if (build != "saas") {
|
if (build !== "saas") {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -737,6 +737,7 @@ authenticated.get(
|
|||||||
"/org/:orgId/labels",
|
"/org/:orgId/labels",
|
||||||
verifyValidLicense,
|
verifyValidLicense,
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
|
verifyValidSubscription(tierMatrix.labels),
|
||||||
verifyUserHasAction(ActionsEnum.listOrgLabels),
|
verifyUserHasAction(ActionsEnum.listOrgLabels),
|
||||||
labels.listOrgLabels
|
labels.listOrgLabels
|
||||||
);
|
);
|
||||||
@@ -745,6 +746,7 @@ authenticated.post(
|
|||||||
"/org/:orgId/labels",
|
"/org/:orgId/labels",
|
||||||
verifyValidLicense,
|
verifyValidLicense,
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
|
verifyValidSubscription(tierMatrix.labels),
|
||||||
verifyUserHasAction(ActionsEnum.createOrgLabel),
|
verifyUserHasAction(ActionsEnum.createOrgLabel),
|
||||||
labels.createOrgLabel
|
labels.createOrgLabel
|
||||||
);
|
);
|
||||||
@@ -753,6 +755,7 @@ authenticated.patch(
|
|||||||
"/org/:orgId/label/:labelId",
|
"/org/:orgId/label/:labelId",
|
||||||
verifyValidLicense,
|
verifyValidLicense,
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
|
verifyValidSubscription(tierMatrix.labels),
|
||||||
verifyUserHasAction(ActionsEnum.updateOrgLabel),
|
verifyUserHasAction(ActionsEnum.updateOrgLabel),
|
||||||
labels.updateOrgLabel
|
labels.updateOrgLabel
|
||||||
);
|
);
|
||||||
@@ -769,6 +772,7 @@ authenticated.put(
|
|||||||
"/org/:orgId/label/:labelId/attach",
|
"/org/:orgId/label/:labelId/attach",
|
||||||
verifyValidLicense,
|
verifyValidLicense,
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
|
verifyValidSubscription(tierMatrix.labels),
|
||||||
verifyUserHasAction(ActionsEnum.attachLabelToItem),
|
verifyUserHasAction(ActionsEnum.attachLabelToItem),
|
||||||
labels.attachLabelToItem
|
labels.attachLabelToItem
|
||||||
);
|
);
|
||||||
@@ -777,6 +781,7 @@ authenticated.put(
|
|||||||
"/org/:orgId/label/:labelId/detach",
|
"/org/:orgId/label/:labelId/detach",
|
||||||
verifyValidLicense,
|
verifyValidLicense,
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
|
verifyValidSubscription(tierMatrix.labels),
|
||||||
verifyUserHasAction(ActionsEnum.detachLabelFromItem),
|
verifyUserHasAction(ActionsEnum.detachLabelFromItem),
|
||||||
labels.detachLabelFromItem
|
labels.detachLabelFromItem
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user