View Source Changelog
This project adheres to Semantic Versioning.
v0.3.3 (2024-09-25)
Fixes
- Support Ecto 3.12+.
v0.3.2 (2023-02-14)
Fixes
- [Janus.Policy] Add missing
@specforallow/3that was causing errors when running Dialyzer.
v0.3.1 (2023-01-17)
Enhancements
- [Janus.Policy] Add rulesets:
Janus.Policy.attach/2,Janus.Policy.allow/3,Janus.Policy.deny/3. - [mix janus.gen.policy] Simplify generated module and function docs.
Fixes
- [Janus.Policy] Fix validation that was incorrectly raising when rules were defined for a schema module whose code hadn't yet been loaded.
v0.3.0 (2023-01-16)
Enhancements
- [Breaking / Janus.Policy] Remove
:modulefield from%Janus.Policy{}struct. - [Breaking / Janus.Policy] Change schema/action argument order in
allow/4anddeny/4to be more consistent with the rest of Janus. See example below. - [Janus.Policy] Add
Janus.Policy.build_policy/1callback primarily to document its usage; an implementation was already injected into policy modules. - [Janus.Policy] Add
:actorfield to%Janus.Policy{}struct.
Example allow/4 and deny/4
# Old argument order
policy
|> allow(:read, Thread, where: [...])
|> allow(:create, Thread, where: [...])
|> deny(:create, Thread, where: [...])
# New argument order
policy
|> allow(Thread, :read, where: [...])
|> allow(Thread, :create, where: [...])
|> deny(Thread, :create, where: [...])v0.2.1 (2023-01-14)
Enhancements
- [Janus.Policy] Raise if something other than a schema is passed to
allow/4ordeny/4.
v0.2.0 (2023-01-05)
Enhancements
- [Breaking / Janus.Policy]
policy_forrenamed tobuild_policy. - [Breaking / Janus.Policy]
before_policy_forremoved. - [Breaking / Janus.Authorization]
filter_authorizedrenamed toscope. - [Breaking / Janus.Authorization]
authorizenow returns{:error, :not_authorized}instead of:error. - [Janus]
use Janusaccepts optional defaults forJanus.Authorization.authorize/4options. - [Janus.Policy] Pre-authorization hooks with
Janus.Policy.attach_hook/4and friends. - [Janus.Authorization]
authorize/4adds:repoand:load_assocationsoptions. - [mix janus.gen.policy] Overhaul generated policy helpers to more easily replace
Ecto.Repocallbacks.
v0.1.0 (2022-12-25)
First release.