defmodule MyApp.Foo.Bar
use Ash.Resource,
authorizers: [Ash.Policy.Authorizer],
data_layer: AshPostgres.DataLayer,
domain: MyApp.Foo,
notifiers: [
Ash.Notifier.PubSub
]
actions do
read :read do
# set up some filters/pagination
end
end
policies do
policy action_type(:read) do
authorize_if {MyApp.FilterCheck1}
authorize_if {MyApp.FilterCheck2}
authorize_if {MyApp.FilterCheck3}
end
end
end
defmodule MyApp.Foo.Bar
use Ash.Resource,
authorizers: [Ash.Policy.Authorizer],
data_layer: AshPostgres.DataLayer,
domain: MyApp.Foo,
notifiers: [
Ash.Notifier.PubSub
]
actions do
read :read do
# set up some filters/pagination
end
end
policies do
policy action_type(:read) do
authorize_if {MyApp.FilterCheck1}
authorize_if {MyApp.FilterCheck2}
authorize_if {MyApp.FilterCheck3}
end
end
end