> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getRoles() # Method package: wixMembersFrontend # Method menu location: wixMembersFrontend --> CurrentMember --> getRoles # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-frontend/current-member/get-roles.md # Method Description: Retrieves the member's roles. `getRoles()` returns a Promise that resolves to the [roles](https://support.wix.com/en/article/site-members-creating-member-roles) of the currently logged-in member. If no member is currently logged in, the Promise is rejected. > **Notes:** > - The member data in the resolved promise will only include custom fields from a site's contacts if those [fields are added to a site's members in a dashboard](https://support.wix.com/en/article/site-members-customizing-your-member-profile-fields). > - The frontend Members APIs aren't fully functional when previewing a site. View a published version of a 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 | # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get the currently logged-in member's roles ```javascript import { currentMember } from 'wix-members-frontend'; // ... currentMember.getRoles() .then((roles) => { return roles; }) .catch((error) => { console.error(error); }); /* Returned roles array: * [ * { * "_id": "42082477-9616-4f15-bf1d-64b2b3049a42", * "_createdDate": "2021-01-31T23:26:56.089Z", * "title": "Forum Gatekeeper", * "description": "Can approve or block members, close discussions, and delete posts", * "color": "LIGHT_GREEN" * }, * { * "_id": "9c3501b4-b8e0-4970-8795-d8ecfea698b7", * "_createdDate": "2021-01-31T23:26:17.535Z", * "title": "Forum Mod", * "description": "Can approve posts from new members and lock discussions", * "color": "VIOLET" * }, * { * "_id": "00000000-0000-0000-0000-000000000001", * "title": "Admin", * "color": "DARK_BLUE" * } * ] */ ``` ---