We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7307c98 commit 073d355Copy full SHA for 073d355
packages/casl-ability/src/Rule.ts
@@ -42,6 +42,7 @@ export class Rule<A extends Abilities, C> {
42
public readonly conditions!: C | undefined;
43
public readonly fields!: string[] | undefined;
44
public readonly reason!: string | undefined;
45
+ public readonly origin!: RawRule<ToAbilityTypes<A>, C>;
46
public readonly priority!: number;
47
48
constructor(
@@ -56,6 +57,7 @@ export class Rule<A extends Abilities, C> {
56
57
this.inverted = !!rule.inverted;
58
this.conditions = rule.conditions;
59
this.reason = rule.reason;
60
+ this.origin = rule;
61
this.fields = rule.fields ? wrapArray(rule.fields) : undefined;
62
this.priority = priority;
63
this._options = options;
0 commit comments