fix(seeds): use :update_internal for system user admin-role
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
:update is blocked for system-actor user; use :update_internal in bootstrap.
This commit is contained in:
parent
c9d6e0c644
commit
ebbb4144a5
1 changed files with 3 additions and 3 deletions
|
|
@ -268,9 +268,9 @@ case Accounts.User
|
||||||
|> Ash.read_one(domain: Mv.Accounts, authorize?: false) do
|
|> Ash.read_one(domain: Mv.Accounts, authorize?: false) do
|
||||||
{:ok, existing_system_user} when not is_nil(existing_system_user) ->
|
{:ok, existing_system_user} when not is_nil(existing_system_user) ->
|
||||||
# System user already exists - ensure it has admin role
|
# System user already exists - ensure it has admin role
|
||||||
# Use authorize?: false for bootstrap
|
# Use authorize?: false for bootstrap; :update_internal bypasses system-user modification block
|
||||||
existing_system_user
|
existing_system_user
|
||||||
|> Ash.Changeset.for_update(:update, %{})
|
|> Ash.Changeset.for_update(:update_internal, %{})
|
||||||
|> Ash.Changeset.manage_relationship(:role, admin_role, type: :append_and_remove)
|
|> Ash.Changeset.manage_relationship(:role, admin_role, type: :append_and_remove)
|
||||||
|> Ash.update!(authorize?: false)
|
|> Ash.update!(authorize?: false)
|
||||||
|
|
||||||
|
|
@ -287,7 +287,7 @@ case Accounts.User
|
||||||
upsert_identity: :unique_email,
|
upsert_identity: :unique_email,
|
||||||
authorize?: false
|
authorize?: false
|
||||||
)
|
)
|
||||||
|> Ash.Changeset.for_update(:update, %{})
|
|> Ash.Changeset.for_update(:update_internal, %{})
|
||||||
|> Ash.Changeset.manage_relationship(:role, admin_role, type: :append_and_remove)
|
|> Ash.Changeset.manage_relationship(:role, admin_role, type: :append_and_remove)
|
||||||
|> Ash.update!(authorize?: false)
|
|> Ash.update!(authorize?: false)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue