Comment on page
OrganizationMembership
The
OrganizationApi
that this object was created with.The organization id that this membership is associated with.
The id of this membership.
The id of the user that this membership is associated with.
const details = await organizationApi.organizationInfo(organizationId)
const [membershipData] = details.memberships
const membership = new OrganizationMembership(organizationApi, membershipData)
Add a new role to this membership.
const role = await membership.addRole('Admin')
Get all the roles associated with this membership.
const roles = await membership.getRoles()
Get the organization associated with this membership.
const organization = await membership.getOrganization()
const ref = membership.reference()
Get this membership's organization profile.
const organizatonProfile = await membership.organizationProfile()
Remove this membership from the organization.
The result is a boolean that indicates success.
if (await membership.remove()) {
// the membership was successfully removed from the organization
}
Last modified 1yr ago