All notable changes to this project will be documented in this file.
8.2.8 (2024-08-23)
8.2.7 (2024-07-16)
- deps: update dependency typescript to ~5.5.0 (ef11301)
8.2.6 (2024-07-14)
8.2.5 (2024-07-14)
8.2.4 (2024-07-14)
- debug release (#939) (80eeb6b)
- deps: update dependency typescript to ~5.3.0 (0ec328c)
- deps: update dependency typescript to ~5.4.0 (1092376)
8.2.3 (2023-11-21)
- changes comment to trigger release (#855) (f13103b)
- ensure pre-post scripts are enabled for pnpm (#853) (fa23801)
8.2.2 (2023-11-21)
8.2.1 (2023-07-20)
8.2.0 (2022-12-17)
8.1.0 (2022-08-28)
8.0.0 (2022-08-20)
- deps: drop support for angular@13, moving to Ivy only!
7.1.0 (2022-08-20)
- angular: implements services that provides Ability as an Observable (5a139b2)
7.0.1 (2022-07-25)
7.0.0 (2022-06-16)
- drops support for angular < 13
6.0.0 (2021-05-31)
- angular: removes deprecated CanPipe and stick to Ivy compiler (82b61f5)
-
angular: there are few important changes:
- deprecated
CanPipe
was removed, useAblePipe
instead - library is compiled by Ivy and no longer support ViewEngine
- deprecated
5.1.2 (2021-05-31)
-
deps: there are 2 important changes:
- deprecated CanPipe was removed, use AblePipe instead
- library is compiled by Ivy and no longer support ViewEngine
5.1.1 (2021-05-12)
- adjusts package tags to improve discoverability (73e88b0)
5.1.0 (2021-01-14)
5.0.2 (2021-01-10)
5.0.1 (2020-12-28)
5.0.0 (2020-12-26)
- angular: removes support for Angular < 9.x and casl < 3.x (3530cdf)
- 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
-
angular: removes support for Angular < 9.x and casl < 3.x
-
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.
4.1.6 (2020-10-21)
- README: adds semi-colon (cad1daa)
4.1.5 (2020-09-03)
4.1.4 (2020-06-09)
4.1.3 (2020-06-08)
4.1.2 (2020-06-02)
- angular: widen peer dependency for @angular/core (aa2c3c4)
4.1.1 (2020-05-19)
4.1.0 (2020-05-19)
4.0.4 (2020-04-14)
- angular: removes ngcc
publishOnly
hook (6e5c570)
4.0.3 (2020-04-14)
- package: allows to disable minification through
LIB_MINIFY
env var (de70838)
4.0.2 (2020-04-10)
- angular: ensure that terser doesn't mangle reserved required props (5371166)
4.0.1 (2020-04-09)
- angular: adds support for casl/ability@4 in package.json (9d65071)
4.0.0 (2020-04-09)
- ability: improves typing for
GetSubjectName
and adds default values for generics (c089293), closes #256 - angular: adds generics to
CanPipe
(68bd287), closes #256 - angular: adds support for action only checks (0462edb), closes #107
- angular: allows to use custom
Ability
instances and improves tree shaking support (2e7a149), closes #249
-
angular: the module doesn't provide
Ability
instance anymore thus it doesn't needforRoot
static method anymoreBefore
import { NgModule } from '@angular/core'; import { AbilityModule } from '@casl/angular'; @NgModule({ imports: [ // other modules AbilityModule.forRoot() ], // other properties }) export class AppModule {}
After
import { NgModule } from '@angular/core'; import { AbilityModule } from '@casl/angular'; import { Ability, PureAbility } from '@casl/ability'; @NgModule({ imports: [ // other modules AbilityModule ], providers: [ { provide: Ability, useValue: new Ability() }, { provide: PureAbility, useExisting: Ability } ] // other properties }) export class AppModule {}
See docs of
@casl/angular
for details -
pipe:
CanPipe
is deprecated in favor ofAblePipe
Before
<div *ngIf="'Post' | can: 'read'">hidden content</div>
After
<div *ngIf="'read' | able: 'Post'">hidden content</div>
3.0.6 (2020-03-06)
- angular: reverts back anngular to not use Ivy as it was not recommend by angular team (b883118), closes #270
3.0.5 (2020-02-21)
3.0.4 (2020-02-21)
3.0.3 (2020-02-21)
3.0.2 (2020-02-20)
3.0.1 (2020-02-20)
- angular: ensures postinstall script uses node to check whether file exists (eba8ef4)
3.0.0 (2020-02-17)
- angular: ensure postinstall hook is executed only during local dev (a47bac8)
- angular: upgrades angular to v9
2.2.0 (2020-02-17)
Deprecated because of invalid package.json peerDependencies and postinstall hook
@casl/angular-v2.1.1 (2019-12-09)
- angular: makes casl-angular much smaller by utilizing tslib.es6 (093cefa)
@casl/angular-v2.1.0 (2019-07-01)
@casl/angular-v2.0.0 (2019-02-10)
- ability:
manage
is not anymore an alias for CRUD but represents any action.
Let's consider the next example:
const ability = AbilityBuilder.define((can) => {
can('manage', 'Post')
can('read', 'User')
})
In @casl/ability@2.x the definition above produces the next results:
ability.can('read', 'Post') // true
ability.can('publish', 'Post') // false, because `manage` is an alias for CRUD
In @casl/ability@3.x the results:
ability.can('read', 'Post') // true
ability.can('publish', 'Post') // true, because `manage` represents any action
To migrate the code, just replace manage
with crud
and everything will work as previously.
@casl/angular-v1.0.0 (2018-12-02)
- angular: adds possibility to use angular module in lazy loaded routes (0c7c3c1)
- angular: Fixes #131
@casl/angular-v0.4.1 (2018-11-11)
@casl/angular-v0.4.0 (2018-11-11)
- angular: converts source to typescript (565936d), closes #126
- README: changes links to @casl/ability to point to npm package instead to git root [skip ci] (a74086b), closes #102
- semantic-release: test (cab3f4b), closes #94
- react:can: updates typescript declarations (213dcde)
@casl/angular-v0.3.1 (2018-07-02)
- angular: supports per field abilities (8268bb4)
- angular: adds angular integration and tests, closes #24