UserGroupMember

Manages the membership of users within groups, tracking who belongs to which group, their role within the group, and the complete lifecycle of their membership. This junction table goes beyond simple user-to-group mapping by recording how users joined (invitation, request, automatic), who approved their membership, when they joined and will leave, and what special roles they have within the group (owner, moderator, member). It handles complex membership scenarios like temporary project assignments where a consultant joins for 3 months, or rotating leadership where the 'team lead' role passes between members monthly. The entity tracks membership status changes, from pending approval through active membership to eventual departure, maintaining history for audit purposes. It supports group-specific roles that are different from system-wide roles - someone might be a 'Viewer' globally but an 'Admin' within their department group. The entity also manages membership inheritance in hierarchical groups and handles conflicts when users belong to multiple groups with different permission sets. This detailed tracking is essential for compliance reporting ('Who had access to financial data last quarter?') and security investigations ('Which groups was this user part of when the breach occurred?').

27 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
membershipIduuid
stored

Unique identifier for this membership record

Required
groupUserGroup
stored

The group the user belongs to

Required
userUser
stored

The user who is a member

Required
memberRolestring
enum

User's role within this specific group

Values: owner, admin, moderator, member, guest, observer

Optional
joinedAtDateTime
stored

When the user joined this group

Required
joinMethodstring
enum

How the user became a member

Values: invited, requested, assigned, automatic, inherited, migrated

Example: "invited"

Required
invitedByUser
stored

Who invited the user to join

Optional
approvedByUser
stored

Who approved the membership request

Optional
approvedAtDateTime
stored

When membership was approved

Optional
statusstring
enum

Current membership status

Values: pending, active, suspended, expired, removed

Required
statusReasonstring
stored

Explanation for current status

Optional
expiresAtDateTime
stored

When membership automatically expires

Optional
renewalDateDateTime
stored

When membership needs renewal

Optional
isPrimaryboolean
stored

Whether this is user's primary group

Optional
isInheritedboolean
stored

Whether membership comes from parent group

Optional
inheritedFromUserGroup
stored

Parent group membership is inherited from

Optional
canLeaveboolean
stored

Whether user can leave voluntarily

Optional
canInviteboolean
stored

Whether member can invite others

Optional
canManageboolean
stored

Whether member can manage group settings

Optional
customPermissionsstring
stored

JSON array of group-specific permissions

Example: "[\"edit_group_resources\",\"view_member_list\"]"

Optional
lastActiveAtDateTime
stored

Last activity within group context

Optional
contributionScoreinteger
stored

Measure of member's group participation

Optional
leftAtDateTime
stored

When user left or was removed

Optional
leftReasonstring
enum

Why membership ended

Values: voluntary, removed, expired, group_deleted, policy, inactive

Optional
removedByUser
stored

Who removed the user from group

Optional
notesstring
stored

Administrative notes about this membership

Optional
metadataobject
stored

Additional membership-specific data

Optional

Examples

Example 1

{
  "@type": "UserGroupMember",
  "membershipId": "mem_abc123",
  "memberRole": "admin",
  "joinedAt": "2024-01-15T10:00:00Z",
  "joinMethod": "invited",
  "invitedBy": "user_cto",
  "approvedBy": "user_cto",
  "approvedAt": "2024-01-15T10:30:00Z",
  "status": "active",
  "isPrimary": true,
  "isInherited": false,
  "canLeave": true,
  "canInvite": true,
  "canManage": true,
  "customPermissions": "[\"manage_team_budget\",\"approve_time_off\",\"conduct_reviews\"]",
  "lastActiveAt": "2024-03-15T14:30:00Z",
  "contributionScore": 847,
  "metadata": {
    "teamLead": true,
    "directReports": 8
  }
}

Example 2

{
  "@type": "UserGroupMember",
  "membershipId": "mem_temp_789",
  "memberRole": "guest",
  "joinedAt": "2024-03-01T09:00:00Z",
  "joinMethod": "requested",
  "approvedBy": "user_project_manager",
  "approvedAt": "2024-03-02T11:00:00Z",
  "status": "active",
  "statusReason": "External contractor for Q2 project",
  "expiresAt": "2024-06-01T00:00:00Z",
  "renewalDate": "2024-05-15T00:00:00Z",
  "isPrimary": false,
  "isInherited": false,
  "canLeave": false,
  "canInvite": false,
  "canManage": false,
  "customPermissions": "[\"view_project_docs\",\"comment_on_tasks\"]",
  "lastActiveAt": "2024-03-14T16:00:00Z",
  "contributionScore": 23,
  "notes": "Contractor from TechCorp, working on API integration",
  "metadata": {
    "contractorCompany": "TechCorp",
    "contractNumber": "CTR-2024-089"
  }
}