Skip to content

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

fix: resovled create failing in bulk create too

=da18a12648f2
diff --git a/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
index b5f5598e33..47de536a63 100644
--- a/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
+++ b/frontend/src/views/SecretOverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
@@ -93,7 +93,24 @@ export const CreateSecretForm = ({
const pathSegment = secretPath.split("/").filter(Boolean);
const parentPath = `/${pathSegment.slice(0, -1).join("/")}`;
const folderName = pathSegment.at(-1);
- if (folderName && parentPath) {
+ const canCreateFolder = permission.rules.some((rule) =>
+ (rule.subject as ProjectPermissionSub[]).includes(ProjectPermissionSub.SecretFolders)
+ )
+ ? permission.can(
+ ProjectPermissionActions.Create,
+ subject(ProjectPermissionSub.SecretFolders, {
+ environment: env.slug,
+ secretPath: parentPath
+ })
+ )
+ : permission.can(
+ ProjectPermissionActions.Create,
+ subject(ProjectPermissionSub.Secrets, {
+ environment: env.slug,
+ secretPath: parentPath
+ })
+ );
+ if (folderName && parentPath && canCreateFolder) {
await createFolder({
projectId: workspaceId,
path: parentPath,