create :create do
accept [:name]
argument :user_id, :binary
change fn changeset, %{actor: actor} = _context ->
changeset |> Ash.Changeset.set_argument(:user_id, actor.id)
end
change manage_relationship(:user_id, :users, type: :append_and_remove)
# ^^^ somehow set :role to :owner in this relationship
end
create :create do
accept [:name]
argument :user_id, :binary
change fn changeset, %{actor: actor} = _context ->
changeset |> Ash.Changeset.set_argument(:user_id, actor.id)
end
change manage_relationship(:user_id, :users, type: :append_and_remove)
# ^^^ somehow set :role to :owner in this relationship
end