Retrieves the member's roles.
The getRoles()
function 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.
Note: The APIs in CurrentMember
are only partially functional when previewing your site. View a published version of your site to see their complete functionality.
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 |