fix: legacy permission check

This commit is contained in:
Daniel Hougaard
2025-03-11 00:08:59 +04:00
parent f1ba64aa66
commit 955657e172
@@ -1127,15 +1127,12 @@ export const secretV2BridgeServiceFactory = ({
actionProjectType: ActionProjectType.SecretManager actionProjectType: ActionProjectType.SecretManager
}); });
ForbiddenError.from(permission).throwUnlessCan( CheckForbiddenErrorSecretsSubject(permission, ProjectPermissionSecretActions.ReadValue, {
ProjectPermissionActions.Read, environment: folderWithPath.environmentSlug,
subject(ProjectPermissionSub.Secrets, { secretPath: folderWithPath.path,
environment: folderWithPath.environmentSlug, secretName: secret.key,
secretPath: folderWithPath.path, secretTags: secret.tags.map((i) => i.slug)
secretName: secret.key, });
secretTags: secret.tags.map((i) => i.slug)
})
);
if (secret.type === SecretType.Personal && secret.userId !== actorId) { if (secret.type === SecretType.Personal && secret.userId !== actorId) {
throw new ForbiddenRequestError({ throw new ForbiddenRequestError({