> 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: wixMembersBackend # Method menu location: wixMembersBackend --> CurrentMember --> getRoles # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-backend/current-member/get-roles.md # Method Description: Retrieves the member's roles. The `getRoles()` function returns a Promise that resolves to the [roles](https://support.wix.com/en/article/creating-member-roles-6943237) 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 | # 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 { Permissions, webMethod } from 'wix-web-module'; import { currentMember } from 'wix-members-backend'; export const myGetRolesFunction = webMethod(Permissions.Anyone, () => { return currentMember.getRoles() .then((roles) => { return roles; }) .catch((error) => { console.error(error); }); }); /* Promise resolves to: * [ * { * "_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" * } * ] */ ``` ---