Skip to content

Commit d54fc64

Browse files
docs(migrations): blank lines around CASL code fence (markdownlint MD031)
1 parent 3039d2c commit d54fc64

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

MIGRATIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Breaking changes and upgrade notes for downstream projects.
1111
### What changed (this repo)
1212

1313
- **`lib/middlewares/policy.js`** — v7 renames `PureAbility` to `Ability` and **drops its default conditions matcher**, so the `Ability` export no longer does MongoDB-style condition matching out of the box (`createMongoAbility` is the replacement for the old behavior). `defineAbilityFor()` now builds via `createMongoAbility`:
14+
1415
```js
1516
// before (v6)
1617
const { AbilityBuilder, Ability } = await import('@casl/ability');
@@ -19,6 +20,7 @@ Breaking changes and upgrade notes for downstream projects.
1920
const { AbilityBuilder, createMongoAbility } = await import('@casl/ability');
2021
const { can, cannot, build } = new AbilityBuilder(createMongoAbility);
2122
```
23+
2224
Without this, conditions like `can('manage', 'Organization', { _id })` stop matching → authorization silently denies → endpoints return 403/422.
2325
- **JSDoc type refs** `import('@casl/ability').Ability``MongoAbility` (`lib/middlewares/policy.js`, `lib/helpers/abilities.js`).
2426
- **`package.json`**`@casl/ability` `^6.8.1``^7.0.0`.

0 commit comments

Comments
 (0)