# Testing viewingSelf from plugin outlet

**URL:** <https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576>\
**Category:** Development\
**Created:** [February 17, 2017, 9:57pm UTC](https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576 "2017-02-17T21:57:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [February 27, 2017, 3:48pm UTC](https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576/4 "2017-02-27T15:48:31Z")

</div>

I don’t recommend using the global objects. We are trying to phase those out because they are essentially global variables.

Instead you should be able to do something like:

```plaintext
const username = this.currentUser ? this.currentUser.get('username') : 'anon';

```

---

_[View the full topic](https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576)._
