> 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: assignRole(roleId: string, memberId: string, options: AuthOptions) # Method package: wixMembersBackend # Method menu location: wixMembersBackend --> Authorization --> assignRole # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-backend/authorization/assign-role.md # Method Description: Assigns a role to a member. The `assignRole()` function returns a Promise that resolves when the specified role is assigned to the specified member. `roleId` must be an ID from an existing role in your site. The role ID can be copied from the Role Settings page. You can access the Role Settings page from your site's [Member Permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions%2Froles%3FreferralInfo%3Dvelo-docs) page. > **Note:** This function may take a few seconds until the role is assigned > and the promise is resolved. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Assign a role to a member ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { authorization } from 'wix-members-backend'; export const myAssignRoleFunction = webMethod(Permissions.Anyone, () => { const roleId = "b62310c1-1c81-4ca9-9fe9-42b48f6e164e"; const memberId = "72751428-2743-4bda-acf5-4218a4279cd3"; const options = { suppressAuth: false }; return authorization.assignRole(roleId, memberId, options) .then(() => { console.log("Role assigned to member"); }) .catch((error) => { console.error(error); }); }); ``` ---