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: :sourceoption - Changed
scopetoscope_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
:scopedto: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.Authorizationbehaviour 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_idis the scoped field andidis an argument nested inside theparamsargument.:id: this is the same as%{id: :id}, where:idis 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}, wherecodeanduser_group_idare 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_roleoption:all_roleis now always set to:all - Replace
rolesoption byvalid_roles - Add
super_roleoption Authorizationbehaviour changed:is_super_role?/1removed, since it's now an optionis_all_role?/1removed:all_roleis not configurable anymore and is set to:allis_role_authorized?/2andis_field_authorized?/3renamed torole_authorized?/2andfield_authorized?/3
Enhancements
- Create schema validation tests
v0.4.0
Breaking Changes
Authorizationbehaviour changed:has_user_access?/3function is nowhas_user_access?/4, as it receives an extra argumentrule.
Enhancements
Authorizationmodule has a new optiondefault_rule, which defaults to:default.- The rule can be passed as an argument for
ObjectScopeAuthorizationandQueryScopeAuthorizationand it's intended to allow custom rules for the same struct, such asread_onlyandwrite_onlyaccess.
v0.3.0
Breaking Changes
-
Authorizationfunctions that receivedAbsinthe's resolution now receive context instead -
ObjectScopeAuthorizationis now an Absinthe Phase and must be added to theAbsinthe's pipeline
Enhancements
- Support nested associations in
ObjectScopeAuthorization