- Nested lists within structs resulted in a
CaseClauseError
during redaction.
- Updated documentation.
- You can now override the exception message used by
c:LetMe.Policy.authorize!/4
(e.g.use LetMe.Policy, error_message: "Not today, chap."
).
- Define
action
type when youuse LetMe.Policy
. - Add type specifications for generated
authorize
functions.
- Added an optional
opts
argument to the authorize functions, so that additional options can be passed to pre-hooks. - Updated
LetMe.filter_rules/2
to allow filtering by meta data.
- Pre-hook options are now expected to be passed as a keyword list.
- Fix deprecation warning about
Logger.warn/2
in Elixir 1.15.
- Added a
metadata
macro to add metadata to actions. The metadata can be read from theLetMe.Rule
struct.
- Update
ex_doc
and other dev dependencies.
- Added a cheat sheet for rules and checks.
- Fixed a code example for rule introspection in the readme.
- Use
Keyword.pop/3
with default value instead ofKeyword.pop!/2
, so that you can pass options toLetMe.redact/3
without passing theredact_value
option.
- Added
c:LetMe.Policy.filter_allowed_actions/3
andLetMe.filter_allowed_actions/4
. - Added
c:LetMe.Policy.get_object_name/1
.
- Renamed
c:LetMe.Policy.authorized?/3
toc:LetMe.Policy.authorize?/3
, because consistency is more important than grammar, maybe. - The
c:LetMe.Schema.scope/2
callback was removed in favour ofc:LetMe.Schema.scope/3
. The__using__
macro defined default implementations for both functions that returned the given query unchanged, in case you only needed theredact
callback of the behaviour. In practice, this made it all too easy to call the 2-arity version when only the 3-arity version was defined, and vice versa, which would lead the query to not be scoped. So in order to reduce the room for error at the cost of a minor inconvenience, you will now always need to implement the 3-arity function, even if you don't need the third argument. - Changed
c:LetMe.Schema.redacted_fields/2
toc:LetMe.Schema.redacted_fields/3
to allow passing additional options, and to be consistent withc:LetMe.Schema.scope/3
.
- Added support for nested field redactions, either by explicitly listing the
fields or by referencing a module that also implements
LetMe.Schema
.
reject_redacted_fields/3
calledredact/2
callback with the wrong argument order.
initial release