mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix: Requesting approvals on previously rejected resources
This commit is contained in:
@@ -128,7 +128,15 @@ export const accessApprovalRequestServiceFactory = ({
|
|||||||
throw new BadRequestError({ message: "You already have an active privilege with the same criteria" });
|
throw new BadRequestError({ message: "You already have an active privilege with the same criteria" });
|
||||||
}
|
}
|
||||||
} else {
|
} 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" });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user