All notable changes to this project will be documented in this file.
1.3.0 (2022-08-28)
1.2.1 (2022-07-25)
1.2.0 (2021-05-12)
- adjusts package tags to improve discoverability (73e88b0)
1.2.0 (2021-05-12)
- adjusts package tags to improve discoverability (73e88b0)
- angular: updates angular to v11 (#421) (ec16bf9)
- prisma: adds prisma integration (#505) (9f91ac4), closes #161 #161
1.1.1 (2020-12-28)
1.1.0 (2020-12-26)
- angular: fixes sourcemap generation for the code built by ngc (7715263), closes #387 #382
- package: removes
engine
section that points to npm@6 (eecd12a), closes #417
- builder: improves typings for AbilityBuilder [skip release] (ebd4d17), closes #379
- esm: adds ESM support for latest Node.js through
exports
prop in package.json (cac2506), closes #331
-
builder: changes main generic parameter to be a class instead of instance and makes
defineAbility
to accept options as the 2nd argument.Before
import { AbilityBuilder, defineAbility, Ability } from '@casl/ability'; const resolveAction = (action: string) => {/* custom implementation */ }; const ability = defineAbility({ resolveAction }, (can) => can('read', 'Item')); const builder = new AbilityBuilder<Ability>(Ability);
After
import { AbilityBuilder, defineAbility, Ability } from '@casl/ability'; const resolveAction = (action: string) => {/* custom implementation */ }; const ability = defineAbility((can) => can('read', 'Item'), { resolveAction }); const builder = new AbilityBuilder(Ability); // first argument is now mandatory!
The 1st parameter to
AbilityBuilder
is now madatory. This allows to infer generic parameters from it and makes AbilityType that is built to be explicit.
1.0.4 (2020-06-09)
1.0.3 (2020-04-10)
- aurelia: ensure that terser doesn't mangle reserved required props (a82dfd5)
- packages: makes eventual lib size to be smaller (93a3bec), closes #287
1.0.2 (2020-04-09)
- aurelia: adds support for casl/ability@4 in package.json (0d1b6db)
1.0.1 (2020-04-09)
- aurelia: adds
able
value converter that allows to do checks only by action (490434b), closes #107 - aurelia: adds generics to can converter and plugin (4d634d7), closes #256
- package: replaces
Ability
withPureAbility
in order to improve tree shaking (c6a01c8), closes #249 - vue: adds better generics typying for Vue (5cc7b60), closes #107
-
valueConverter:
CanValueConverter
is deprecated in favor ofAbleValueConverter
Before
<div if.bind="'Post' | can: 'read'">hidden content</div>
After
<div if.bind="'read' | able: 'Post'">hidden content</div>
-
di: replaces
Ability
DI token withPureAbility
Before
import { Ability } from '@casl/ability' export function configure(config) { config.container.registerInstance(Ability, new Ability()) }
After
import { PureAbility, Ability } from '@casl/ability' export function configure(config) { const ability = new Ability() // the token below is used by value converters config.container.registerInstance(PureAbility, ability) config.container.registerInstance(Ability, ability) }
-
typescript: weak hand written declaration files are removed as
@casl/aurelia
has been completely rewritten to TypeScript.
@casl/aurelia-v0.5.0 (2019-02-10)
- packages: increases peerDependency of @casl/ability (9f6a7b8), closes #119
- README: changes links to @casl/ability to point to npm package instead to git root [skip ci] (a74086b), closes #102
@casl/aurelia-v0.4.1 (2018-07-02)
@casl/aurelia-v0.4.0 (2018-07-02)
- aurelia: upgrades to the latest version of aurelia (8833993)
- aurelia: support for per field abilities (1ca5051)
- aurelia: fixes tests in aurelia to properly check ability rules for emptiness (42e2ddb)
- aurelia: adds package for Aurelia, closes #26