Skip to content

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

Fix: Requesting approvals on previously rejected resources

Daniel Hougaardc7d2dfd351ab
diff --git a/backend/src/ee/services/access-approval-request/access-approval-request-service.ts b/backend/src/ee/services/access-approval-request/access-approval-request-service.ts
index b7b61fd8e0..d9762d879c 100644
--- a/backend/src/ee/services/access-approval-request/access-approval-request-service.ts
+++ b/backend/src/ee/services/access-approval-request/access-approval-request-service.ts
@@ -128,7 +128,15 @@ export const accessApprovalRequestServiceFactory = ({
throw new BadRequestError({ message: "You already have an active privilege with the same criteria" });
}
} else {
- throw new BadRequestError({ message: "You already have a pending access request with the same criteria" });
+ const reviewers = await accessApprovalRequestReviewerDAL.find({
+ requestId: duplicateRequest.id
+ });
+
+ const isRejected = reviewers.some((reviewer) => reviewer.status === ApprovalStatus.REJECTED);
+
+ if (!isRejected) {
+ throw new BadRequestError({ message: "You already have a pending access request with the same criteria" });
+ }
}
}