NDaniil
NDaniil
AEAsh Elixir
Created by NDaniil on 5/13/2023 in #support
How to read resource without actions
every Ash resource is an Ecto schema
Awesome, this is what I was looking for. I just found an introspection tool to get a list of actions without reading AshAuthentication source code.
iex(6)> Ash.Resource.Info.actions(MyApp.Accounts.Token) |> Enum.filter(& &1.type == :read) |> Enum.map(& &1.name)
[:get_token, :get_confirmation_changes, :revoked?, :read_expired]
iex(6)> Ash.Resource.Info.actions(MyApp.Accounts.Token) |> Enum.filter(& &1.type == :read) |> Enum.map(& &1.name)
[:get_token, :get_confirmation_changes, :revoked?, :read_expired]
My problem can also be solved by adding action: :read
MyApp.Streams.read(MyApp.Streams.Event, action: :read)
MyApp.Streams.read(MyApp.Streams.Event, action: :read)
3 replies