Skip to content

Commit

Permalink
Release 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dennemark committed Sep 26, 2024
1 parent 3a57167 commit f933cbf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## [0.6.3](https://github.com/dennemark/prisma-extension-casl/compare/0.6.2...0.6.3) (2024-09-26)


### Bug Fixes

* :bug: store permission on null not possible ([3a57167](https://github.com/dennemark/prisma-extension-casl/commit/3a5716789f72cbd2557a88582f5d2234c7e29c9d))

## [0.6.2](https://github.com/dennemark/prisma-extension-casl/compare/0.6.1...0.6.2) (2024-09-25)


Expand Down
14 changes: 8 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,12 +1275,14 @@ function storePermissions(result, abilities, model, prop) {
}
const actions = ["create", "read", "update", "delete"];
const storeProp = (entry) => {
entry[prop] = [];
actions.forEach((action) => {
if (abilities.can(action, getSubject(model, entry))) {
entry[prop].push(action);
}
});
if (entry) {
entry[prop] = [];
actions.forEach((action) => {
if (abilities.can(action, getSubject(model, entry))) {
entry[prop].push(action);
}
});
}
return entry;
};
if (Array.isArray(result)) {
Expand Down
14 changes: 8 additions & 6 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,12 +1250,14 @@ function storePermissions(result, abilities, model, prop) {
}
const actions = ["create", "read", "update", "delete"];
const storeProp = (entry) => {
entry[prop] = [];
actions.forEach((action) => {
if (abilities.can(action, getSubject(model, entry))) {
entry[prop].push(action);
}
});
if (entry) {
entry[prop] = [];
actions.forEach((action) => {
if (abilities.can(action, getSubject(model, entry))) {
entry[prop].push(action);
}
});
}
return entry;
};
if (Array.isArray(result)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prisma-extension-casl",
"version": "0.6.2",
"version": "0.6.3",
"description": "Enforce casl abilities on prisma client ",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit f933cbf

Please sign in to comment.