File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -405,9 +405,9 @@ findAll() {
405
405
Alternatively, we can define a class which implements the ` IPolicyHandler ` interface:
406
406
407
407
``` typescript
408
- export class CreateArticlePolicyHandler implements IPolicyHandler {
408
+ export class ReadArticlePolicyHandler implements IPolicyHandler {
409
409
handle(ability : AppAbility ) {
410
- return ability .can (Action .Create , Article );
410
+ return ability .can (Action .Read , Article );
411
411
}
412
412
}
413
413
```
@@ -417,7 +417,7 @@ And use it as follows:
417
417
``` typescript
418
418
@Get ()
419
419
@UseGuards (PoliciesGuard )
420
- @CheckPolicies (new CreateArticlePolicyHandler ())
420
+ @CheckPolicies (new ReadArticlePolicyHandler ())
421
421
findAll () {
422
422
return this .articlesService .findAll ();
423
423
}
You can’t perform that action at this time.
0 commit comments