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
+15 -15
View File
@@ -197,7 +197,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -315,7 +315,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -460,7 +460,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -557,7 +557,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
let paths: { folderId: string; path: string }[] = [];
@@ -665,7 +665,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionActions.Read,
@@ -765,7 +765,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionActions.Create,
@@ -852,7 +852,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -961,7 +961,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionActions.Delete,
@@ -2237,7 +2237,7 @@ export const secretServiceFactory = ({
projectId: folder.projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRollback);
const secretVersions = await secretVersionDAL.find({ secretId }, { offset, limit, sort: [["createdAt", "desc"]] });
@@ -2273,7 +2273,7 @@ export const secretServiceFactory = ({
projectId: project.id,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -2379,7 +2379,7 @@ export const secretServiceFactory = ({
projectId: project.id,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -2486,7 +2486,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
if (!hasRole(ProjectMembershipRole.Admin))
@@ -2571,7 +2571,7 @@ export const secretServiceFactory = ({
projectId: project.id,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
@@ -2960,7 +2960,7 @@ export const secretServiceFactory = ({
projectId,
actorAuthMethod,
actorOrgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
if (!hasRole(ProjectMembershipRole.Admin))
@@ -2989,7 +2989,7 @@ export const secretServiceFactory = ({
projectId: params.projectId,
actorAuthMethod: actor.authMethod,
actorOrgId: actor.orgId,
projectOperationType: ActionProjectType.SecretManager
actionProjectType: ActionProjectType.SecretManager
});
const secrets = secretV2BridgeService.getSecretsByFolderMappings({ ...params, userId: actor.id }, permission);