# Testing viewingSelf from plugin outlet

**URL:** <https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576>\
**Category:** Development\
**Created:** [17 فبراير 2017، 9:57م UTC](https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576 "2017-02-17T21:57:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [17 فبراير 2017، 10:12م UTC](https://meta.discourse.org/t/testing-viewingself-from-plugin-outlet/57576/2 "2017-02-17T22:12:59Z")

</div>

> [@LeoDavidson](#):
>
> don’t seem to exist on this

I thought for the most part a lot if the “main” objects had global scope, but you may need to pass the Discourse object to the function.

For currentUser try something like

```plaintext
var username = Discourse.User.currentProp('username') || "anon";

```

---

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