feat(user_live): handle system user in form and show
Early return / load_user_or_redirect, use system_user? to avoid editing system actor.
This commit is contained in:
parent
a10c770ca7
commit
cbcb93418e
2 changed files with 15 additions and 17 deletions
|
|
@ -75,7 +75,7 @@ defmodule MvWeb.UserLive.Show do
|
|||
actor = current_actor(socket)
|
||||
user = Ash.get!(Mv.Accounts.User, id, domain: Mv.Accounts, load: [:member], actor: actor)
|
||||
|
||||
if to_string(user.email) == Mv.Helpers.SystemActor.system_user_email() do
|
||||
if Mv.Helpers.SystemActor.system_user?(user) do
|
||||
{:ok,
|
||||
socket
|
||||
|> put_flash(:error, gettext("This user cannot be viewed."))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue