# ShieldUser access in field formatters

**URL:** <https://discuss.elastic.co/t/shielduser-access-in-field-formatters/157080>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [November 16, 2018, 2:13pm UTC](https://discuss.elastic.co/t/shielduser-access-in-field-formatters/157080 "2018-11-16T14:13:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hooch](https://avatars.discourse-cdn.com/v4/letter/h/9fc29f/32.png) [@hooch](https://discuss.elastic.co/u/hooch)\
**Post date:** [November 16, 2018, 2:13pm UTC](https://discuss.elastic.co/t/shielduser-access-in-field-formatters/157080/1 "2018-11-16T14:13:51Z")

</div>

I'm trying to write a new field formatter in Kibana 6.4.2, and in it I would like to use the username of the currently logged in user. I see that this can be done using the ShieldUser service, but I don't know how I can inject that dependency or get a handle of that service in the field formatter functions. Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [November 16, 2018, 3:38pm UTC](https://discuss.elastic.co/t/shielduser-access-in-field-formatters/157080/2 "2018-11-16T15:38:47Z")

</div>

@timroes @Stacey_Gammon - can either of you shed some light here ?

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 14, 2018, 3:38pm UTC](https://discuss.elastic.co/t/shielduser-access-in-field-formatters/157080/3 "2018-12-14T15:38:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
