# Returning the logged in user's name with a custom script

**URL:** https://community.dreamfactory.com/t/returning-the-logged-in-users-name-with-a-custom-script/1365
**Category:** Server-Side Scripting
**Created:** [August 12, 2015, 7:25am UTC](https://community.dreamfactory.com/t/returning-the-logged-in-users-name-with-a-custom-script/1365 "2015-08-12T07:25:45Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)
#### Post date: [August 12, 2015, 2:35pm UTC](https://community.dreamfactory.com/t/returning-the-logged-in-users-name-with-a-custom-script/1365/5 "2015-08-12T14:35:07Z")

</div>

Bear with me while I try to understand your use case further.

From a server-side perspective, how would the user’s name be the logged-in user’s name? You could have ten, or a hundred, or a thousand users logged in at any given time.

Plus, each client device knows what his own user’s name is: it’s available to him at `rest/user/profile` and it’s returned to him in the response to his login `POST /rest/user/session`, so the client could provide his own user name along with any API call at any time.

If you’re simply concerned about table-level or row-level data security, I recommend checking out some of the below links. I assume you’ve read them already, I just need to know how/why they don’t fit your use case.

- [Restricting access to DB rows by user](https://community.dreamfactory.com/t/access-to-database-rows/1161/2?u=jeffreystables)
- [Each user only having access to his own DB table](https://community.dreamfactory.com/t/how-would-i-manage-in-the-dsp-every-user-has-his-her-own-todo-list/181?u=jeffreystables)
- [Post-process script that limits records returned based on user](https://community.dreamfactory.com/t/limit-api-responses-based-on-user-or-role/693?u=jeffreystables)
- [How to implement table-level permissions based on user](https://community.dreamfactory.com/t/how-to-implement-data-access-based-on-a-table-with-users-permissions/490/2?u=jeffreystables)
- [Server-side filtering by record owner](https://github.com/dreamfactorysoftware/dsp-core/wiki/Server-Side-Filters#filter-by-record-owner)

---

_[View the full topic](https://community.dreamfactory.com/t/returning-the-logged-in-users-name-with-a-custom-script/1365)._
