From 32c07302c36cfdd147bc6eebc135b084bab2a471 Mon Sep 17 00:00:00 2001 From: dennemark Date: Tue, 29 Oct 2024 13:27:50 +0100 Subject: [PATCH] Release 1.0.1 --- CHANGELOG.md | 6 ++++++ dist/index.js | 2 +- dist/index.mjs | 2 +- package.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c15e4f..7ef0ce2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ +## [1.0.1](https://github.com/dennemark/prisma-extension-casl/compare/1.0.0...1.0.1) (2024-10-29) + +### Bug Fixes + +* :bug: correct store permissions for chained queries ([fcbd014](https://github.com/dennemark/prisma-extension-casl/commit/fcbd0142f29d9a5b1d0a02391d7d45f59a6bfeec)) + ## [1.0.0](https://github.com/dennemark/prisma-extension-casl/compare/0.8.1...1.0.0) (2024-10-23) ### ⚠ BREAKING CHANGES diff --git a/dist/index.js b/dist/index.js index 314cf8a..f6a00d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1256,7 +1256,7 @@ function getNestedQueryRelations(args, abilities, action, model, creationSelectQ const relationField = relationFieldsByModel[model][relation]; if (relationField) { const nestedQueryRelations = { - ...getNestedQueryRelations(args[method][relation], abilities, "read", relationField.type), + ...getNestedQueryRelations(args[method][relation], abilities, action === "all" ? "all" : "read", relationField.type), ...queryRelations[relation]?.select ?? {} }; if (nestedQueryRelations && Object.keys(nestedQueryRelations).length > 0) { diff --git a/dist/index.mjs b/dist/index.mjs index b2354b2..4abb97a 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1231,7 +1231,7 @@ function getNestedQueryRelations(args, abilities, action, model, creationSelectQ const relationField = relationFieldsByModel[model][relation]; if (relationField) { const nestedQueryRelations = { - ...getNestedQueryRelations(args[method][relation], abilities, "read", relationField.type), + ...getNestedQueryRelations(args[method][relation], abilities, action === "all" ? "all" : "read", relationField.type), ...queryRelations[relation]?.select ?? {} }; if (nestedQueryRelations && Object.keys(nestedQueryRelations).length > 0) { diff --git a/package.json b/package.json index 8300d94..e32794d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prisma-extension-casl", - "version": "1.0.0", + "version": "1.0.1", "description": "Enforce casl abilities on prisma client ", "main": "dist/index.js", "types": "dist/index.d.ts",