Skip to content

Commit

Permalink
Fix object scope authorization when scope is false
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielpra1 committed Aug 8, 2019
1 parent 27fcbe6 commit 0364347
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The package can be installed by adding `rajska` to your list of dependencies in
```elixir
def deps do
[
{:rajska, "~> 0.1.0"},
{:rajska, "~> 0.2.2"},
]
end
```
Expand Down
2 changes: 1 addition & 1 deletion lib/middlewares/object_scope_authorization.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ defmodule Rajska.ObjectScopeAuthorization do

defp is_authorized?(nil, _, object, _nested_keys), do: raise "No meta scope defined for object #{inspect object.identifier}"

defp is_authorized?(false, resolution, _object, _nested_keys), do: resolution
defp is_authorized?(false, _resolution, _object, _nested_keys), do: true

defp is_authorized?({scoped_struct, field}, resolution, _object, nested_keys) do
field_keys = nested_keys ++ [field]
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Rajska.MixProject do
def project do
[
app: :rajska,
version: "0.2.1",
version: "0.2.2",
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down

0 comments on commit 0364347

Please sign in to comment.