mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 12:56:29 +00:00
misc: add delete protection for projects on create
This commit is contained in:
@@ -252,7 +252,8 @@ export const projectServiceFactory = ({
|
||||
tx: trx,
|
||||
createDefaultEnvs = true,
|
||||
template = InfisicalProjectTemplate.Default,
|
||||
type = ProjectType.SecretManager
|
||||
type = ProjectType.SecretManager,
|
||||
hasDeleteProtection
|
||||
}: TCreateProjectDTO) => {
|
||||
const organization = await orgDAL.findOne({ id: actorOrgId });
|
||||
const { permission } = await permissionService.getOrgPermission({
|
||||
@@ -325,7 +326,8 @@ export const projectServiceFactory = ({
|
||||
slug,
|
||||
kmsSecretManagerKeyId: kmsKeyId,
|
||||
version: ProjectVersion.V3,
|
||||
pitVersionLimit: 10
|
||||
pitVersionLimit: 10,
|
||||
hasDeleteProtection
|
||||
},
|
||||
tx
|
||||
);
|
||||
@@ -587,6 +589,7 @@ export const projectServiceFactory = ({
|
||||
actorOrgId,
|
||||
actionProjectType: ActionProjectType.Any
|
||||
});
|
||||
|
||||
return project;
|
||||
};
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export type TCreateProjectDTO = {
|
||||
pitVersionLimit?: number;
|
||||
tx?: Knex;
|
||||
type?: ProjectType;
|
||||
hasDeleteProtection?: boolean;
|
||||
};
|
||||
|
||||
export type TDeleteProjectBySlugDTO = {
|
||||
|
||||
Reference in New Issue
Block a user