unstale

npm / @casl/ability

@casl/ability

What changed in @casl/ability 6 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

8 breaking2 security1 behavior and defaults4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

@casl/ability 714 changes

Breaking changes 8

  • Ability replaces PureAbility and no longer has default options; use createMongoAbility and MongoAbility to get the previous Ability behavior.

    7.0.0release notes

  • An empty conditions object now matches all.

    7.0.0release notes

  • The exported getDefaultErrorMessage function was removed.

    7.0.0release notes

  • possibleRulesFor now returns readonly Rule[], so callers can no longer treat its result as a mutable array.

    7.0.0release notes

  • PureAbility was renamed to Ability.

    7.0.0release notes

  • rulesFor now returns readonly Rule[], so callers can no longer treat its result as a mutable array.

    7.0.0release notes

  • rulesToCondition replaces rulesToQuery.

    7.0.0release notes

  • rulesToQuery has been replaced by rulesToCondition.

    7.0.0release notes

Security 1

  • Prevents rulesToFields from setting properties on prototypes and non-objects.

    7.0.2release notes

Behavior and default changes 1

  • Conditions that semantically match everything are treated the same as rules without conditions.

    7.0.0release notes

Fixes and other changes 4

  • Adds bugs metadata to all packages, giving developers a package-level issue-tracker reference.

    7.0.1release notes

  • Adds defensive protection against undefined returned from the rule conditions matcher.

    7.0.0release notes

  • Prevents the rules index cache from being polluted with undefined actions.

    7.0.0release notes

  • rulesToAST now generates conditions that respect rule priority.

    7.0.0release notes

@casl/ability 61 changes

Security 1