fix: legacy permission check

This commit is contained in:
Daniel Hougaard
2025-03-08 03:58:15 +04:00
parent f1ba64aa66
commit 955657e172

View File

@@ -1127,15 +1127,12 @@ export const secretV2BridgeServiceFactory = ({
actionProjectType: ActionProjectType.SecretManager
});
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionActions.Read,
subject(ProjectPermissionSub.Secrets, {
environment: folderWithPath.environmentSlug,
secretPath: folderWithPath.path,
secretName: secret.key,
secretTags: secret.tags.map((i) => i.slug)
})
);
CheckForbiddenErrorSecretsSubject(permission, ProjectPermissionSecretActions.ReadValue, {
environment: folderWithPath.environmentSlug,
secretPath: folderWithPath.path,
secretName: secret.key,
secretTags: secret.tags.map((i) => i.slug)
});
if (secret.type === SecretType.Personal && secret.userId !== actorId) {
throw new ForbiddenRequestError({