refactor: updated permission service for projects to check for operation type as well

This commit is contained in:
=
2025-01-14 23:26:18 +05:30
parent 0cef728617
commit 989065ba34
46 changed files with 1603 additions and 1257 deletions
+8 -6
View File
@@ -3,6 +3,7 @@ import { subject } from "@casl/ability";
import path from "path";
import {
ProjectOperationType,
SecretEncryptionAlgo,
SecretKeyEncoding,
SecretType,
@@ -176,13 +177,14 @@ export const recursivelyGetSecretPaths = ({
folderId: p.folderId
}));
const { permission } = await permissionService.getProjectPermission(
auth.actor,
auth.actorId,
const { permission } = await permissionService.getProjectPermission({
actor: auth.actor,
actorId: auth.actorId,
projectId,
auth.actorAuthMethod,
auth.actorOrgId
);
actorAuthMethod: auth.actorAuthMethod,
actorOrgId: auth.actorOrgId,
projectOperationType: ProjectOperationType.SecretManager
});
// Filter out paths that the user does not have permission to access, and paths that are not in the current path
const allowedPaths = paths.filter(