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?
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
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
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.
Thanks, Andreas. I will post a feature request to make the API documentation more accurate for these kinds of things.