getUserGroupsByMembership

Function

Retrieves the user's groups categorized by their membership type.

Parameters

Parameter Type Default Notes
user Required IUser

The user object containing group information.

Returns

An object categorizing the user's groups into owner, admin, and member.

The function processes the user's groups and classifies them based on the membership type:

  • owner: Groups where the user is an owner.
  • admin: Groups where the user is an admin.
  • member: Groups where the user is a member and the group is not view-only.

Note: The none membership type is not considered as it is not expected to be present in the user's groups.

Property Type Notes
admin string[]

Groups where the user is an admin, allowing them to add / remove members, as well as share content they do not own

member string[]

Groups where the user is a member. ViewOnly groups will not be included in this list.

owner string[]

Groups where the user is the owner, allowing them to add / remove members, as well as share content they do not own


Function defined in common/src/search/_internal/getUserGroupsByMembership.ts:18