Merge pull request #3115 from Infisical/fix-check-permissions-on-before-load-integrations

Fix (temp): Wrap Integrations beforeLoad in Try/Catch and RenderBannerGuard if order
This commit is contained in:
Scott Wilson
2025-02-13 08:27:59 -08:00
committed by GitHub
3 changed files with 43 additions and 16 deletions
@@ -57,6 +57,10 @@ export const ProjectPermissionCan: FunctionComponent<Props<ProjectPermissionSet>
const finalChild =
typeof children === "function" ? children(isAllowed, ability as any) : children;
if (!isAllowed && renderGuardBanner) {
return <ProjectPermissionGuardBanner />;
}
if (!isAllowed && passThrough) {
return <Tooltip content={label}>{finalChild}</Tooltip>;
}
@@ -65,10 +69,6 @@ export const ProjectPermissionCan: FunctionComponent<Props<ProjectPermissionSet>
return <Tooltip content={allowedLabel}>{finalChild}</Tooltip>;
}
if (!isAllowed && renderGuardBanner) {
return <ProjectPermissionGuardBanner />;
}
if (!isAllowed) return null;
return finalChild;