mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
fix: resovled create failing in bulk create too
This commit is contained in:
+18
-1
@@ -93,7 +93,24 @@ export const CreateSecretForm = ({
|
|||||||
const pathSegment = secretPath.split("/").filter(Boolean);
|
const pathSegment = secretPath.split("/").filter(Boolean);
|
||||||
const parentPath = `/${pathSegment.slice(0, -1).join("/")}`;
|
const parentPath = `/${pathSegment.slice(0, -1).join("/")}`;
|
||||||
const folderName = pathSegment.at(-1);
|
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({
|
await createFolder({
|
||||||
projectId: workspaceId,
|
projectId: workspaceId,
|
||||||
path: parentPath,
|
path: parentPath,
|
||||||
|
|||||||
Reference in New Issue
Block a user