v0.6.0
Breaking Changes
-
Renamed query authorization option
:scoped
to:scope
, which accept the following values:false
: disables scopingUser
: a module that will be passed toc:Rajska.Authorization.has_user_access?/4
. It must implement aRajska.Authorization
behaviour and a__schema__(:source)
function (used to check if the module is valid inRajska.Schema.validate_query_auth_config!/2
)
-
The following options were added to query authorization:
:args
%{user_id: [:params, :id]}
: whereuser_id
is the scoped field andid
is an argument nested inside theparams
argument.:id
: this is the same as%{id: :id}
, where:id
is both the query argument and the scoped field that will be passed to has_user_access?/4[:code, :user_group_id]
: this is the same as%{code: :code, user_group_id: :user_group_id}
, wherecode
anduser_group_id
are both query arguments and scoped fields.
:optional
(optional) - when set to true the arguments are optional, so if no argument is provided, the query will be authorized. Defaults to false.
-
has_user_access?/4 now receives
{field, field_value}
as the third argument, instead of onlyfield_value
Enhancements
- Create validations for all query authorization options