Use current_actor/1 helper in all LiveViews
Replace inconsistent actor access patterns with current_actor/1 helper and ensure actor is passed to all Ash operations for proper authorization.
This commit is contained in:
parent
74fe60f768
commit
cd7e6b0843
9 changed files with 268 additions and 57 deletions
|
|
@ -20,6 +20,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
"""
|
||||
use MvWeb, :live_view
|
||||
import Ash.Query
|
||||
import MvWeb.LiveHelpers, only: [current_actor: 1]
|
||||
|
||||
on_mount {MvWeb.LiveHelpers, :ensure_user_role_loaded}
|
||||
|
||||
|
|
@ -236,7 +237,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
|
||||
@impl true
|
||||
def handle_params(%{"id" => id}, _, socket) do
|
||||
actor = socket.assigns[:current_user]
|
||||
actor = current_actor(socket)
|
||||
|
||||
# Load custom fields once using assign_new to avoid repeated queries
|
||||
socket =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue