feat: updated all permission argument to actionProjectType

This commit is contained in:
=
2025-01-14 23:41:06 +05:30
parent 6f38d6c76f
commit 3a5bb31bde
45 changed files with 310 additions and 313 deletions
@@ -103,7 +103,7 @@ export const integrationAuthServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const authorizations = await integrationAuthDAL.find({ projectId });
@@ -121,7 +121,7 @@ export const integrationAuthServiceFactory = ({
projectId: auth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
return permission.can(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
@@ -139,7 +139,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
return integrationAuth;
@@ -165,7 +165,7 @@ export const integrationAuthServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Integrations);
@@ -275,7 +275,7 @@ export const integrationAuthServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Integrations);
@@ -410,7 +410,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Integrations);
@@ -672,7 +672,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
@@ -707,7 +707,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
@@ -738,7 +738,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -780,7 +780,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -809,7 +809,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -884,7 +884,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -932,7 +932,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -967,7 +967,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1026,7 +1026,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1063,7 +1063,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1105,7 +1105,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1146,7 +1146,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1187,7 +1187,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1227,7 +1227,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1268,7 +1268,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1337,7 +1337,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1412,7 +1412,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1463,7 +1463,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1512,7 +1512,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1581,7 +1581,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1623,7 +1623,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1736,7 +1736,7 @@ export const integrationAuthServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.Integrations);
@@ -1760,7 +1760,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.Integrations);
@@ -1794,7 +1794,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(sourcePermission).throwUnlessCan(
@@ -1808,7 +1808,7 @@ export const integrationAuthServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(targetPermission).throwUnlessCan(
@@ -1841,7 +1841,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);
@@ -1882,7 +1882,7 @@ export const integrationAuthServiceFactory = ({
projectId: integrationAuth.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integrationAuth.projectId);