fix: ending a policy w/ authorize_if had flipped conditional

This commit is contained in:
Zach Daniel 2024-03-31 23:53:39 -04:00
parent bc34287edc
commit 3eaeb864ea
2 changed files with 1 additions and 16 deletions

View file

@ -538,7 +538,7 @@ defmodule Ash.Policy.Policy do
{true, authorizer}
{:error, authorizer} ->
{{clause.check_module, clause.check_opts}, authorizer}
{{:not, {clause.check_module, clause.check_opts}}, authorizer}
end
end

View file

@ -15,19 +15,4 @@ defmodule Ash.Test.Resource.ValidateAcceptTest do
end
end
end
test "Accepting an attribute that is private raises an error" do
assert_raise DslError, ~r/\[:secret\], because they are not public attributes/, fn ->
defposts do
attributes do
attribute :secret, :string
end
actions do
default_accept :*
create :example_action, accept: [:secret]
end
end
end
end
end