You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What createCan does when a bare-subject check is made against a subject
whose only matching rules carry conditions.
Remarks
ability.can('update', 'Note') asks CASL "is updating a Note possible at
all?", not "may I update this Note?" — a rule of
can('update', 'Note', { userId }) makes the bare check return true for every
caller. Omitting getSubjectData there silently discards the conditions, with
no type error to catch it.
'warn' (default) — allow the check, but log once per rule. Non-breaking.
'throw' — deny with an explanatory error. Recommended for new projects.
'allow' — say nothing. For deliberate "is this possible at all" gates, e.g.
guarding a list field whose rows are filtered inside the resolver.
The object names each mode: onUnconditionedSubject: UnconditionedSubjectMode.Throw.