Describe the feature
// REMOVED — no longer compiles
await guantr.can('read', 'post');
await guantr.cannot('read', 'post');
// REQUIRED — use dedicated methods
await guantr.canAbstract('read', 'post');
await guantr.cannotAbstract('read', 'post');
// Resource-aware unchanged
await guantr.can('read', ['post', postInstance]);
Rationale
The string overload was deprecated in v1.1.0. It operates under fundamentally different
semantics (allow-exists only, deny not evaluated) from the tuple overload (full evaluation,
deny overrides allow). Sharing the same method name made it too easy to misuse the
abstract check for actual authorization decisions.
Migration
Find-and-replace:
guantr.can(action, 'resource') → guantr.canAbstract(action, 'resource')
guantr.cannot(action, 'resource') → guantr.cannotAbstract(action, 'resource')
Implementation Tasks
Additional information
Final checks
Describe the feature
Rationale
The string overload was deprecated in v1.1.0. It operates under fundamentally different
semantics (allow-exists only, deny not evaluated) from the tuple overload (full evaluation,
deny overrides allow). Sharing the same method name made it too easy to misuse the
abstract check for actual authorization decisions.
Migration
Find-and-replace:
guantr.can(action, 'resource')→guantr.canAbstract(action, 'resource')guantr.cannot(action, 'resource')→guantr.cannotAbstract(action, 'resource')Implementation Tasks
can()resource parametercannot()resource parameterif (typeof resource === 'string')branch fromcan()scripts/migrate-v2.ts(optional convenience)Additional information
Final checks