Releases: jungsoft/rajska
Releases · jungsoft/rajska
v.0.7.0
Breaking Changes
- Changed validations to require any struct instead of an Ecto schema
Object Scope Authorization:
- Removed
scope: :source
option - Changed
scope
toscope_by
, using the returned struct as scope - Added
meta :rule
Enhancements
- Added tests for queries that return primitives (e.g.
:string
)
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
v0.5.0
Breaking Changes
- Remove
all_role
option:all_role
is now always set to:all
- Replace
roles
option byvalid_roles
- Add
super_role
option Authorization
behaviour changed:is_super_role?/1
removed, since it's now an optionis_all_role?/1
removed:all_role
is not configurable anymore and is set to:all
is_role_authorized?/2
andis_field_authorized?/3
renamed torole_authorized?/2
andfield_authorized?/3
Enhancements
- Create schema validation tests
v0.4.0
Breaking Changes
Authorization
behaviour changed:has_user_access?/3
function is nowhas_user_access?/4
, as it receives an extra argumentrule
.
Enhancements
Authorization
module has a new optiondefault_rule
, which defaults to:default
.- The rule can be passed as an argument for
ObjectScopeAuthorization
andQueryScopeAuthorization
and it's intended to allow custom rules for the same struct, such asread_only
andwrite_only
access.
v0.3.0
Breaking Changes
-
Authorization
functions that receivedAbsinthe
's resolution now receive context instead -
ObjectScopeAuthorization
is now an Absinthe Phase and must be added to theAbsinthe
's pipeline
Enhancements
- Support nested associations in
ObjectScopeAuthorization