[x] I think the usage doc for each middleware should include adding it to the schema
[x] Does scope: :source still makes sense in scope authorization? I added it in PM, but I'm not using it anymore and can't think a use case for it right now.
[x] Does a global config makes sense? It looks like all configuration can be made through the use Rajska call
[x] get_user_role and is_super_user? are overridable functions and take the resolution as an argument. My question here is if there is an use case for overriding this functionality. Can't we achieve the same level of flexibility by just overriding get_current_user and get_user_role(that would only take the user as argument)?
get_scope_by_field/2
should have bang: https://github.com/rschef/rajska/blob/master/lib/middlewares/field_authorization.ex#L44schema
scope: :source
still makes sense in scope authorization? I added it in PM, but I'm not using it anymore and can't think a use case for it right now.use Rajska
callbehaviour
should be implemented for the overridable functions, so the compiler can check them. See https://elixirforum.com/t/behaviours-defoverridable-and-implementations/3338 and https://elixir-lang.org/getting-started/typespecs-and-behaviours.htmlget_user_role
andis_super_user?
are overridable functions and take the resolution as an argument. My question here is if there is an use case for overriding this functionality. Can't we achieve the same level of flexibility by just overridingget_current_user
andget_user_role
(that would only take the user as argument)?