Skip to content

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

Renew flow permission fix

Carlos Monastyrski48c8ff687cf0
diff --git a/backend/src/services/certificate-v3/certificate-v3-service.ts b/backend/src/services/certificate-v3/certificate-v3-service.ts
index b258ce27cf..84d6d5174c 100644
--- a/backend/src/services/certificate-v3/certificate-v3-service.ts
+++ b/backend/src/services/certificate-v3/certificate-v3-service.ts
@@ -2233,16 +2233,30 @@ export const certificateV3ServiceFactory = ({
if (!internal) {
const projectId = profile?.projectId || originalCert.projectId;
- const { permission } = await permissionService.getProjectPermission({
- actor,
- actorId,
- projectId,
- actorAuthMethod,
- actorOrgId,
- actionProjectType: ActionProjectType.CertificateManager
- });
- if (profile) {
+ if (originalCert.applicationId) {
+ const { permission } = await permissionService.getResourcePermission({
+ actor,
+ actorId,
+ projectId,
+ resourceType: ResourceType.CertificateApplication,
+ resourceId: originalCert.applicationId,
+ actorAuthMethod,
+ actorOrgId
+ });
+ ForbiddenError.from(permission).throwUnlessCan(
+ ResourcePermissionCertificateActions.Create,
+ ResourcePermissionSub.Certificates
+ );
+ } else if (profile) {
+ const { permission } = await permissionService.getProjectPermission({
+ actor,
+ actorId,
+ projectId,
+ actorAuthMethod,
+ actorOrgId,
+ actionProjectType: ActionProjectType.CertificateManager
+ });
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionCertificateProfileActions.IssueCert,
subject(ProjectPermissionSub.CertificateProfiles, { slug: profile.slug })