Retrieves the member's roles.
getRoles() returns a Promise that resolves to the
roles
of the currently logged-in member.
If no member is currently logged in, the Promise is rejected.
Notes:
The following results are returned depending on the session identity:
| Session Identity | Promise Resolves To |
|---|---|
| Logged-in member | Array of member roles |
| Site owner or contributor with admin permissions | Array of member roles, plus an additional role where name is Admin |
| Anyone else | Promise is rejected |
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.