# Assign user to one ressource - Front -end edition

**URL:** <https://community.modx.com/t/assign-user-to-one-ressource-front-end-edition/1089>\
**Category:** Extras\
**Created:** [June 24, 2019, 9:18am UTC](https://community.modx.com/t/assign-user-to-one-ressource-front-end-edition/1089 "2019-06-24T09:18:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [September 13, 2019, 3:06am UTC](https://community.modx.com/t/assign-user-to-one-ressource-front-end-edition/1089/7 "2019-09-13T03:06:38Z")

</div>

About my code above. Notice the very first line:

```auto
/* Assuming that you have the $user object */

$profile = $user->getOne('Profile');

```

If you don’t already have the user object, you have to get it before calling `getOne()`.

In the front end, that would be either this at the top:

```auto
$user = $modx->user;

```

or just changing the code to:

```auto
$profile = $modx->user->getOne('Profile');

```

---

_[View the full topic](https://community.modx.com/t/assign-user-to-one-ressource-front-end-edition/1089)._
