LiveViews should be able to use stuff developed as part of https://github.com/curiosum-dev/permit/issues/2 (querying accessible records for a subject) to get and execute Ecto queries preloading accessible records in :index and similar live_actions.
Example usage:
defmodule Permit.FakeApp.SomeLiveView do
use Phoenix.LiveView, namespace: Permit
use Permit.LiveViewAuthorization,
authorization_module: Authorization,
resource_module: Item
@impl true
def mount(_params, _session, %{assigns: %{live_action: :index}} = socket) do
# socket.assigns.loaded_resources is present
{:ok, socket}
end
def handle_params(_params, _url, %{assigns: %{live_action: :index}} = socket) do
# socket.assigns.loaded_resources is present
{:noreply, socket}
end
end
LiveViews should be able to use stuff developed as part of https://github.com/curiosum-dev/permit/issues/2 (querying accessible records for a subject) to get and execute Ecto queries preloading accessible records in :index and similar
live_action
s.Example usage: