Is it possible to assign multiple roles to a member ?


import { authorization } from ‘wix-members-backend’;

export function myAssignRoleFunction() {
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);
});
}


I would like to know that is it possible to give roles like; principal, teacher, student (multiple roles) to a single registered user via this code?

Yes, you can. Try it and see.

Thanks I tried and It did. : )