# getRoles() in Preview Mode

**URL:** <https://forum.wixstudio.com/t/getroles-in-preview-mode/14422>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [November 10, 2018, 11:30pm UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422 "2018-11-10T23:30:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davebogan98](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@davebogan98](https://forum.wixstudio.com/u/davebogan98)\
**Post date:** [November 10, 2018, 11:30pm UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422/1 "2018-11-10T23:30:49Z")

</div>

Am trying to test the wix-users getRoles() function, but it does not seem to be working in Preview Mode. The API reference notes that, _“The APIs in wix-users are only partially functional when previewing your site.”_ Does getRoles() happen to be one of those API’s that only works in published mode (it does work there), or is there something going on with wix-users?

---

<div class="post-metadata">

**Author:** ![massasalah18](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/massasalah18/32/876_2.png) [@massasalah18](https://forum.wixstudio.com/u/massasalah18)\
**Post date:** [November 11, 2018, 8:18am UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422/2 "2018-11-11T08:18:38Z")

</div>

Hello

on the preview site you’re always the admin of the website, try it on the life site using different members details.

Best  
Massa

---

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [November 11, 2018, 8:19am UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422/3 "2018-11-11T08:19:16Z")

</div>

Yes, that seem to only work in published mode. I think roles from membership only has data in live mode and none in sandbox. I have posted a feature request to be able to click Preview As… and dropdown to let you choose user to preview site with

---

<div class="post-metadata">

**Author:** ![davebogan98](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@davebogan98](https://forum.wixstudio.com/u/davebogan98)\
**Post date:** [November 11, 2018, 3:41pm UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422/4 "2018-11-11T15:41:19Z")

</div>

While that is true, with the addition of member roles, it is possible for the website admin to have other roles besides admin. It would be much more convenient to test these conditions in the sandbox rather than only in the published site.

---

<div class="post-metadata">

**Author:** ![davebogan98](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@davebogan98](https://forum.wixstudio.com/u/davebogan98)\
**Post date:** [November 11, 2018, 3:41pm UTC](https://forum.wixstudio.com/t/getroles-in-preview-mode/14422/5 "2018-11-11T15:41:22Z")

</div>

Thanks, Andreas. I will post a feature request to make the API documentation more accurate for these kinds of things.
