mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: properly return false
on forbidden errors
This commit is contained in:
parent
2fcacc4be6
commit
979b4e648d
1 changed files with 6 additions and 0 deletions
|
@ -537,6 +537,9 @@ defmodule Ash.Api do
|
|||
end
|
||||
|
||||
case authorizer.strict_check(authorizer_state, context) do
|
||||
{:error, %{class: :forbidden} = e} when is_exception(e) ->
|
||||
{:halt, {false, nil}}
|
||||
|
||||
{:error, error} ->
|
||||
{:halt, {:error, error}}
|
||||
|
||||
|
@ -563,6 +566,9 @@ defmodule Ash.Api do
|
|||
end
|
||||
)
|
||||
|> case do
|
||||
{:error, error} ->
|
||||
{:error, error}
|
||||
|
||||
{true, query} when not is_nil(query) ->
|
||||
if opts[:run_queries?] do
|
||||
case query_or_changeset do
|
||||
|
|
Loading…
Reference in a new issue