Releases: curiosum-dev/permit
Releases · curiosum-dev/permit
v0.3.0
Changed
-
[Breaking] Change order of args in
Permit.verify_record/3and add delegation asdo?/3when doinguse Permit.This way, permisisons to perform a dynamically computed action can be checked like this:
action = :read can(user) |> do?(action, %Item{id: 1})
instead of the previously required, rather clumsy, and undocumented notation:
# Note: this is the previously used argument order; as of now, arguments 2 and 3 have been reversed. can(user) |> Permit.verify_record(%Item{id: 1}, action)
If you happened to use
Permit.verify_record(3), the way to migrate is swapping arguments 2 and 3 in all calls, or - better still - migrating to thedo?/3syntactic sugar.
Fixed
- Update CI configuration and dependencies.