ash/test/support/policy_complex/domain.ex
2024-09-02 14:11:09 -04:00

20 lines
564 B
Elixir

defmodule Ash.Test.Support.PolicyComplex.Domain do
@moduledoc false
use Ash.Domain,
extensions: [Ash.Policy.Authorizer]
resources do
resource(Ash.Test.Support.PolicyComplex.User)
resource(Ash.Test.Support.PolicyComplex.FriendLink)
resource(Ash.Test.Support.PolicyComplex.Post)
resource(Ash.Test.Support.PolicyComplex.Comment)
resource(Ash.Test.Support.PolicyComplex.Bio)
end
policies do
policy always() do
access_type :strict
authorize_unless actor_attribute_equals(:forbidden_by_domain, true)
end
end
end