# Code interface for resource owned by User

**URL:** <https://forum.elixirforum.com/t/code-interface-for-resource-owned-by-user/58982>\
**Category:** Questions\
**Tags:** ash, ash-authentication, ash-code-interface\
**Created:** [October 15, 2023, 12:01am UTC](https://forum.elixirforum.com/t/code-interface-for-resource-owned-by-user/58982 "2023-10-15T00:01:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![dewetblomerus](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dewetblomerus/32/27370_2.png) [@dewetblomerus](https://forum.elixirforum.com/u/dewetblomerus)\
**Post date:** [October 17, 2023, 2:34pm UTC](https://forum.elixirforum.com/t/code-interface-for-resource-owned-by-user/58982/7 "2023-10-17T14:34:41Z")

</div>

> [@zachdaniel](#):
>
> `change relate_actor(:user)`

Badabing Badaboom 💥

This worked:

```elixir
  changes do
    change relate_actor(:user)
  end

```

I was able to remove the `attribute_writable?: true` from the relationship.

And now this works:

```elixir
Red.Practice.Card.create!(%{
  word: "the"
}, actor: user)

```

---

_[View the full topic](https://forum.elixirforum.com/t/code-interface-for-resource-owned-by-user/58982)._
