feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303)

Before this change, the `organization_members` table keyed on user_id —
joining an org as a Viewer in tenant T meant only that one user got
visibility on shared KBs/agents, while the rest of T (including its
Owner) saw nothing. The mismatch surfaced as confusing UX bugs:
"my colleague shared this with us, why can't I see it?"

This change replaces `organization_members` with
`organization_tenant_members`. Membership and Org-RBAC role now key on
(org_id, tenant_id); `representative_user_id` stays as a display-only
label of the user who first brought the tenant in.

Permission resolution gains a 3-D cap so tenant-RBAC stays honest under
cross-tenant sharing:

  effective = min(share.Permission, tenant_org_role, tenant_role_cap)

where tenant_role_cap pins tenant Viewers to OrgRoleViewer regardless
of the org-level grant. A Viewer in their own tenant cannot edit a
shared KB even if the org granted Editor — preserves the
"Viewer = read-only everywhere" promise.

Migration 000045 backfills `organization_tenant_members` from the old
table by collapsing each (org, tenant) group to its max role, then
renames the old table to `organization_members_pre_plan3` for safe
rollback. Sqlite mirror (Lite mode) is fresh-bootstrap: the init
schema replaces the old table directly.

Routes: member-management URLs change from `:user_id` to `:tenant_id`.
Org create / join / leave now require Admin+ in the caller's tenant —
joining an Org affects everyone in T, so the decision can't sit with
a Viewer.

Frontend: OrganizationSettingsModal + store update to address members
by tenant_id.
This commit is contained in:
wizardchen
2026-05-15 21:49:54 +08:00
committed by lyingbug
parent c89563a273
commit 928f5abe3f
29 changed files with 955 additions and 643 deletions
+88 -57
View File
@@ -7,99 +7,126 @@ import (
"github.com/Tencent/WeKnora/internal/types"
)
// OrganizationService defines the organization service interface
// OrganizationService defines the organization service interface.
//
// Plan 3 of #1303: organization membership is per-tenant, not per-user.
// Adding/removing/updating "members" therefore takes a tenant_id, and
// permission checks key on (org, tenant). RepresentativeUserID is
// informational and not load-bearing.
type OrganizationService interface {
// Organization CRUD
CreateOrganization(ctx context.Context, userID string, tenantID uint64, req *types.CreateOrganizationRequest) (*types.Organization, error)
GetOrganization(ctx context.Context, id string) (*types.Organization, error)
GetOrganizationByInviteCode(ctx context.Context, inviteCode string) (*types.Organization, error)
ListUserOrganizations(ctx context.Context, userID string) ([]*types.Organization, error)
UpdateOrganization(ctx context.Context, id string, userID string, req *types.UpdateOrganizationRequest) (*types.Organization, error)
DeleteOrganization(ctx context.Context, id string, userID string) error
ListTenantOrganizations(ctx context.Context, tenantID uint64) ([]*types.Organization, error)
UpdateOrganization(ctx context.Context, id string, userID string, tenantID uint64, req *types.UpdateOrganizationRequest) (*types.Organization, error)
DeleteOrganization(ctx context.Context, id string, userID string, tenantID uint64) error
// Member Management
AddMember(ctx context.Context, orgID string, userID string, tenantID uint64, role types.OrgMemberRole) error
RemoveMember(ctx context.Context, orgID string, memberUserID string, operatorUserID string) error
UpdateMemberRole(ctx context.Context, orgID string, memberUserID string, role types.OrgMemberRole, operatorUserID string) error
ListMembers(ctx context.Context, orgID string) ([]*types.OrganizationMember, error)
GetMember(ctx context.Context, orgID string, userID string) (*types.OrganizationMember, error)
// Member Management (Plan 3: members are tenants)
// AddTenantMember adds a tenant to the org with the given role; representativeUserID
// is only used for display labelling.
AddTenantMember(ctx context.Context, orgID string, tenantID uint64, representativeUserID string, role types.OrgMemberRole) error
RemoveTenantMember(ctx context.Context, orgID string, memberTenantID uint64, operatorUserID string, operatorTenantID uint64) error
UpdateTenantMemberRole(ctx context.Context, orgID string, memberTenantID uint64, role types.OrgMemberRole, operatorUserID string, operatorTenantID uint64) error
ListTenantMembers(ctx context.Context, orgID string) ([]*types.OrganizationTenantMember, error)
GetTenantMember(ctx context.Context, orgID string, tenantID uint64) (*types.OrganizationTenantMember, error)
// Invite Code
GenerateInviteCode(ctx context.Context, orgID string, userID string) (string, error)
GenerateInviteCode(ctx context.Context, orgID string, userID string, tenantID uint64) (string, error)
JoinByInviteCode(ctx context.Context, inviteCode string, userID string, tenantID uint64) (*types.Organization, error)
// Searchable organizations (discovery)
SearchSearchableOrganizations(ctx context.Context, userID string, query string, limit int) (*types.ListSearchableOrganizationsResponse, error)
SearchSearchableOrganizations(ctx context.Context, tenantID uint64, query string, limit int) (*types.ListSearchableOrganizationsResponse, error)
JoinByOrganizationID(ctx context.Context, orgID string, userID string, tenantID uint64, message string, requestedRole types.OrgMemberRole) (*types.Organization, error)
// Join Requests (for organizations that require approval)
SubmitJoinRequest(ctx context.Context, orgID string, userID string, tenantID uint64, message string, requestedRole types.OrgMemberRole) (*types.OrganizationJoinRequest, error)
ListJoinRequests(ctx context.Context, orgID string) ([]*types.OrganizationJoinRequest, error)
CountPendingJoinRequests(ctx context.Context, orgID string) (int64, error)
ReviewJoinRequest(ctx context.Context, orgID string, requestID string, approved bool, reviewerID string, message string, assignRole *types.OrgMemberRole) error
ReviewJoinRequest(ctx context.Context, orgID string, requestID string, approved bool, reviewerID string, reviewerTenantID uint64, message string, assignRole *types.OrgMemberRole) error
// Role Upgrade Requests (for existing members to request higher permissions)
// Role Upgrade Requests (for existing tenants to request higher permissions)
RequestRoleUpgrade(ctx context.Context, orgID string, userID string, tenantID uint64, requestedRole types.OrgMemberRole, message string) (*types.OrganizationJoinRequest, error)
GetPendingUpgradeRequest(ctx context.Context, orgID string, userID string) (*types.OrganizationJoinRequest, error)
GetPendingUpgradeRequest(ctx context.Context, orgID string, tenantID uint64) (*types.OrganizationJoinRequest, error)
// Permission Check
IsOrgAdmin(ctx context.Context, orgID string, userID string) (bool, error)
GetUserRoleInOrg(ctx context.Context, orgID string, userID string) (types.OrgMemberRole, error)
// Permission Check (drive purely off the requesting tenant)
IsTenantOrgAdmin(ctx context.Context, orgID string, tenantID uint64) (bool, error)
GetTenantRoleInOrg(ctx context.Context, orgID string, tenantID uint64) (types.OrgMemberRole, error)
}
// OrganizationRepository defines the organization repository interface
// OrganizationRepository defines the organization repository interface.
//
// Members are stored per-tenant in `organization_tenant_members`.
type OrganizationRepository interface {
// Organization CRUD
Create(ctx context.Context, org *types.Organization) error
GetByID(ctx context.Context, id string) (*types.Organization, error)
GetByInviteCode(ctx context.Context, inviteCode string) (*types.Organization, error)
ListByUserID(ctx context.Context, userID string) ([]*types.Organization, error)
ListByTenantID(ctx context.Context, tenantID uint64) ([]*types.Organization, error)
ListSearchable(ctx context.Context, query string, limit int) ([]*types.Organization, error)
Update(ctx context.Context, org *types.Organization) error
Delete(ctx context.Context, id string) error
// Member operations
AddMember(ctx context.Context, member *types.OrganizationMember) error
RemoveMember(ctx context.Context, orgID string, userID string) error
UpdateMemberRole(ctx context.Context, orgID string, userID string, role types.OrgMemberRole) error
ListMembers(ctx context.Context, orgID string) ([]*types.OrganizationMember, error)
GetMember(ctx context.Context, orgID string, userID string) (*types.OrganizationMember, error)
ListMembersByUserForOrgs(ctx context.Context, userID string, orgIDs []string) (map[string]*types.OrganizationMember, error)
CountMembers(ctx context.Context, orgID string) (int64, error)
// Tenant member operations
AddTenantMember(ctx context.Context, member *types.OrganizationTenantMember) error
RemoveTenantMember(ctx context.Context, orgID string, tenantID uint64) error
UpdateTenantMemberRole(ctx context.Context, orgID string, tenantID uint64, role types.OrgMemberRole) error
ListTenantMembers(ctx context.Context, orgID string) ([]*types.OrganizationTenantMember, error)
GetTenantMember(ctx context.Context, orgID string, tenantID uint64) (*types.OrganizationTenantMember, error)
ListTenantMembersByTenantForOrgs(ctx context.Context, tenantID uint64, orgIDs []string) (map[string]*types.OrganizationTenantMember, error)
CountTenantMembers(ctx context.Context, orgID string) (int64, error)
// Invite code
UpdateInviteCode(ctx context.Context, orgID string, inviteCode string, expiresAt *time.Time) error
// Join requests
// Join requests (still keyed on the *requesting* user, but a single
// pending request per (org, tenant) since the approve action grants
// the whole tenant access).
CreateJoinRequest(ctx context.Context, request *types.OrganizationJoinRequest) error
GetJoinRequestByID(ctx context.Context, id string) (*types.OrganizationJoinRequest, error)
GetPendingJoinRequest(ctx context.Context, orgID string, userID string) (*types.OrganizationJoinRequest, error)
GetPendingRequestByType(ctx context.Context, orgID string, userID string, requestType types.JoinRequestType) (*types.OrganizationJoinRequest, error)
GetPendingJoinRequestByTenant(ctx context.Context, orgID string, tenantID uint64) (*types.OrganizationJoinRequest, error)
GetPendingRequestByTenantAndType(ctx context.Context, orgID string, tenantID uint64, requestType types.JoinRequestType) (*types.OrganizationJoinRequest, error)
ListJoinRequests(ctx context.Context, orgID string, status types.JoinRequestStatus) ([]*types.OrganizationJoinRequest, error)
CountJoinRequests(ctx context.Context, orgID string, status types.JoinRequestStatus) (int64, error)
UpdateJoinRequestStatus(ctx context.Context, id string, status types.JoinRequestStatus, reviewedBy string, reviewMessage string) error
}
// KBShareService defines the knowledge base sharing service interface
// KBShareService defines the knowledge base sharing service interface.
//
// Plan 3 of #1303: permission resolution keys on the caller's tenant
// (not user). The 3-dimension cap is applied inside CheckTenantKBPermission
// and is the canonical permission gate for shared KBs:
//
// effective = min(share.Permission, tenant_org_role, tenant_role_cap)
//
// where tenant_role_cap pins tenant Viewers to OrgRoleViewer regardless
// of the org-level grant — Viewer in your own tenant must always be
// read-only on shared resources.
type KBShareService interface {
// Share Management
ShareKnowledgeBase(ctx context.Context, kbID string, orgID string, userID string, tenantID uint64, permission types.OrgMemberRole) (*types.KnowledgeBaseShare, error)
UpdateSharePermission(ctx context.Context, shareID string, permission types.OrgMemberRole, userID string) error
RemoveShare(ctx context.Context, shareID string, userID string) error
UpdateSharePermission(ctx context.Context, shareID string, permission types.OrgMemberRole, userID string, tenantID uint64) error
RemoveShare(ctx context.Context, shareID string, userID string, tenantID uint64) error
// Query
// ListSharesByKnowledgeBase lists shares for a KB; tenantID must own the KB (authz check).
ListSharesByKnowledgeBase(ctx context.Context, kbID string, tenantID uint64) ([]*types.KnowledgeBaseShare, error)
ListSharesByOrganization(ctx context.Context, orgID string) ([]*types.KnowledgeBaseShare, error)
ListSharedKnowledgeBases(ctx context.Context, userID string, currentTenantID uint64) ([]*types.SharedKnowledgeBaseInfo, error)
ListSharedKnowledgeBasesInOrganization(ctx context.Context, orgID string, userID string, currentTenantID uint64) ([]*types.OrganizationSharedKnowledgeBaseItem, error)
ListSharedKnowledgeBases(ctx context.Context, tenantID uint64, callerTenantRole types.TenantRole) ([]*types.SharedKnowledgeBaseInfo, error)
ListSharedKnowledgeBasesInOrganization(ctx context.Context, orgID string, tenantID uint64, callerTenantRole types.TenantRole) ([]*types.OrganizationSharedKnowledgeBaseItem, error)
// ListSharedKnowledgeBaseIDsByOrganizations returns per-org direct shared KB IDs (batch, for sidebar count).
ListSharedKnowledgeBaseIDsByOrganizations(ctx context.Context, orgIDs []string, userID string) (map[string][]string, error)
ListSharedKnowledgeBaseIDsByOrganizations(ctx context.Context, orgIDs []string, tenantID uint64) (map[string][]string, error)
GetShare(ctx context.Context, shareID string) (*types.KnowledgeBaseShare, error)
GetShareByKBAndOrg(ctx context.Context, kbID string, orgID string) (*types.KnowledgeBaseShare, error)
// Permission Check
CheckUserKBPermission(ctx context.Context, kbID string, userID string) (types.OrgMemberRole, bool, error)
HasKBPermission(ctx context.Context, kbID string, userID string, requiredRole types.OrgMemberRole) (bool, error)
// Permission Check (Plan 3: tenant-keyed). Returns the effective
// OrgMemberRole the caller can use against the shared KB after the
// 3-D cap, plus a bool indicating whether *any* share matches the
// caller's tenant. callerTenantRole is the caller's tenant-RBAC
// role and is used to apply the Viewer cap.
CheckTenantKBPermission(ctx context.Context, kbID string, callerTenantID uint64, callerTenantRole types.TenantRole) (types.OrgMemberRole, bool, error)
// HasTenantKBPermission is a thin "do I have at least N" wrapper over
// CheckTenantKBPermission.
HasTenantKBPermission(ctx context.Context, kbID string, callerTenantID uint64, callerTenantRole types.TenantRole, requiredRole types.OrgMemberRole) (bool, error)
// Get source tenant for cross-tenant embedding
GetKBSourceTenant(ctx context.Context, kbID string) (uint64, error)
@@ -129,34 +156,38 @@ type KBShareRepository interface {
ListByOrganizations(ctx context.Context, orgIDs []string) ([]*types.KnowledgeBaseShare, error)
CountByOrganizations(ctx context.Context, orgIDs []string) (map[string]int64, error)
// Query for user's accessible shared knowledge bases
ListSharedKBsForUser(ctx context.Context, userID string) ([]*types.KnowledgeBaseShare, error)
// Query for tenant's accessible shared knowledge bases
ListSharedKBsForTenant(ctx context.Context, tenantID uint64) ([]*types.KnowledgeBaseShare, error)
// Count shares
CountSharesByKnowledgeBaseID(ctx context.Context, kbID string) (int64, error)
CountSharesByKnowledgeBaseIDs(ctx context.Context, kbIDs []string) (map[string]int64, error)
}
// AgentShareService defines the agent sharing service interface
// AgentShareService defines the agent sharing service interface.
//
// Plan 3 of #1303: visibility and access checks key on the caller's
// tenant. callerTenantRole flows through so the 3-D cap (tenant Viewer
// → at most OrgRoleViewer) can be applied consistently.
type AgentShareService interface {
ShareAgent(ctx context.Context, agentID string, orgID string, userID string, tenantID uint64, permission types.OrgMemberRole) (*types.AgentShare, error)
RemoveShare(ctx context.Context, shareID string, userID string) error
RemoveShare(ctx context.Context, shareID string, userID string, tenantID uint64) error
ListSharesByAgent(ctx context.Context, agentID string) ([]*types.AgentShare, error)
ListSharesByOrganization(ctx context.Context, orgID string) ([]*types.AgentShare, error)
ListSharedAgents(ctx context.Context, userID string, currentTenantID uint64) ([]*types.SharedAgentInfo, error)
ListSharedAgentsInOrganization(ctx context.Context, orgID string, userID string, currentTenantID uint64) ([]*types.OrganizationSharedAgentItem, error)
ListSharedAgents(ctx context.Context, tenantID uint64, callerTenantRole types.TenantRole) ([]*types.SharedAgentInfo, error)
ListSharedAgentsInOrganization(ctx context.Context, orgID string, tenantID uint64, callerTenantRole types.TenantRole) ([]*types.OrganizationSharedAgentItem, error)
// ListSharedAgentsInOrganizations returns per-org agent list (batch, for sidebar count merge).
ListSharedAgentsInOrganizations(ctx context.Context, orgIDs []string, userID string, currentTenantID uint64) (map[string][]*types.OrganizationSharedAgentItem, error)
// SetSharedAgentDisabledByMe sets whether the current tenant has "disabled" this shared agent for their conversation dropdown (per-user preference).
ListSharedAgentsInOrganizations(ctx context.Context, orgIDs []string, tenantID uint64, callerTenantRole types.TenantRole) (map[string][]*types.OrganizationSharedAgentItem, error)
// SetSharedAgentDisabledByMe sets whether the current tenant has "disabled" this shared agent for their conversation dropdown (per-tenant preference; will be revisited in a follow-up PR).
SetSharedAgentDisabledByMe(ctx context.Context, tenantID uint64, agentID string, sourceTenantID uint64, disabled bool) error
// GetSharedAgentForUser returns the shared agent by agentID if the user has access (source tenant is resolved from share); used to resolve KB scope for @ mention.
GetSharedAgentForUser(ctx context.Context, userID string, currentTenantID uint64, agentID string) (*types.CustomAgent, error)
// UserCanAccessKBViaSomeSharedAgent returns true if the user has at least one shared agent that can access the given KB (for opening KB detail from "通过智能体可见" list without passing agent_id).
UserCanAccessKBViaSomeSharedAgent(ctx context.Context, userID string, currentTenantID uint64, kb *types.KnowledgeBase) (bool, error)
// GetSharedAgentForTenant returns the shared agent by agentID if the caller's tenant has access; used to resolve KB scope for @ mention.
GetSharedAgentForTenant(ctx context.Context, tenantID uint64, callerTenantRole types.TenantRole, agentID string) (*types.CustomAgent, error)
// TenantCanAccessKBViaSomeSharedAgent returns true if the caller's tenant has at least one shared agent that can access the given KB (for opening KB detail from "通过智能体可见" list without passing agent_id).
TenantCanAccessKBViaSomeSharedAgent(ctx context.Context, tenantID uint64, callerTenantRole types.TenantRole, kb *types.KnowledgeBase) (bool, error)
GetShare(ctx context.Context, shareID string) (*types.AgentShare, error)
GetShareByAgentAndOrg(ctx context.Context, agentID string, orgID string) (*types.AgentShare, error)
// GetShareByAgentIDForUser returns one share for the given agentID that the user can access, excluding source_tenant_id == excludeTenantID (e.g. current tenant to get shared-from-other only).
GetShareByAgentIDForUser(ctx context.Context, userID, agentID string, excludeTenantID uint64) (*types.AgentShare, error)
// GetShareByAgentIDForTenant returns one share for the given agentID that the tenant can access, excluding source_tenant_id == excludeTenantID (e.g. caller's own tenant to get shared-from-other only).
GetShareByAgentIDForTenant(ctx context.Context, tenantID uint64, agentID string, excludeTenantID uint64) (*types.AgentShare, error)
// CountByOrganizations returns share counts per organization (for sidebar); excludes deleted agents
CountByOrganizations(ctx context.Context, orgIDs []string) (map[string]int64, error)
}
@@ -173,10 +204,10 @@ type AgentShareRepository interface {
ListByAgent(ctx context.Context, agentID string) ([]*types.AgentShare, error)
ListByOrganization(ctx context.Context, orgID string) ([]*types.AgentShare, error)
ListByOrganizations(ctx context.Context, orgIDs []string) ([]*types.AgentShare, error)
ListSharedAgentsForUser(ctx context.Context, userID string) ([]*types.AgentShare, error)
ListSharedAgentsForTenant(ctx context.Context, tenantID uint64) ([]*types.AgentShare, error)
CountByOrganizations(ctx context.Context, orgIDs []string) (map[string]int64, error)
// GetShareByAgentIDForUser returns one share for the given agentID that the user can access (user in org), excluding source_tenant_id == excludeTenantID.
GetShareByAgentIDForUser(ctx context.Context, userID, agentID string, excludeTenantID uint64) (*types.AgentShare, error)
// GetShareByAgentIDForTenant returns one share for the given agentID that the tenant can access (tenant in org), excluding source_tenant_id == excludeTenantID.
GetShareByAgentIDForTenant(ctx context.Context, tenantID uint64, agentID string, excludeTenantID uint64) (*types.AgentShare, error)
}
// TenantDisabledSharedAgentRepository stores per-tenant "disabled" agents (hidden from conversation dropdown; own and shared)
+41 -24
View File
@@ -38,6 +38,25 @@ func (r OrgMemberRole) HasPermission(required OrgMemberRole) bool {
return roleLevel[r] >= roleLevel[required]
}
// MinOrgRole returns whichever of a / b is the lower role on the
// admin > editor > viewer ladder. Used to apply caps when combining
// (a) the share's grant, (b) the tenant's role inside the org, and
// (c) the caller's tenant-RBAC ceiling. A zero/empty role is treated
// as "less than viewer" so it short-circuits to whatever the other
// argument is.
func MinOrgRole(a, b OrgMemberRole) OrgMemberRole {
if a == "" {
return b
}
if b == "" {
return a
}
if a.HasPermission(b) {
return b
}
return a
}
// Organization represents a collaboration organization for cross-tenant sharing
type Organization struct {
// Unique identifier of the organization
@@ -70,9 +89,9 @@ type Organization struct {
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
// Associations (not stored in database)
Owner *User `json:"owner,omitempty" gorm:"foreignKey:OwnerID"`
Members []OrganizationMember `json:"members,omitempty" gorm:"foreignKey:OrganizationID"`
Shares []KnowledgeBaseShare `json:"shares,omitempty" gorm:"foreignKey:OrganizationID"`
Owner *User `json:"owner,omitempty" gorm:"foreignKey:OwnerID"`
Members []OrganizationTenantMember `json:"members,omitempty" gorm:"foreignKey:OrganizationID"`
Shares []KnowledgeBaseShare `json:"shares,omitempty" gorm:"foreignKey:OrganizationID"`
}
// TableName returns the table name for GORM
@@ -80,31 +99,29 @@ func (Organization) TableName() string {
return "organizations"
}
// OrganizationMember represents a member of an organization
type OrganizationMember struct {
// Unique identifier
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
// Organization ID
OrganizationID string `json:"organization_id" gorm:"type:varchar(36);not null;index"`
// User ID of the member
UserID string `json:"user_id" gorm:"type:varchar(36);not null;index"`
// Tenant ID that the member belongs to
TenantID uint64 `json:"tenant_id" gorm:"not null;index"`
// Role in the organization (admin/editor/viewer)
Role OrgMemberRole `json:"role" gorm:"type:varchar(32);not null;default:'viewer'"`
// Creation time
CreatedAt time.Time `json:"created_at"`
// Last updated time
UpdatedAt time.Time `json:"updated_at"`
// OrganizationTenantMember represents a tenant participating in an
// organization. Plan 3 of #1303 lifts the "Org member" abstraction from
// per-user (`organization_members`) to per-tenant (this table). The
// representative_user_id is informational only — the user who first
// brought this tenant into the org — and is used purely for UI/audit
// labels. Permission checks are driven exclusively by (org, tenant, role).
type OrganizationTenantMember struct {
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
OrganizationID string `json:"organization_id" gorm:"type:varchar(36);not null;index"`
TenantID uint64 `json:"tenant_id" gorm:"not null;index"`
Role OrgMemberRole `json:"role" gorm:"type:varchar(32);not null;default:'viewer'"`
RepresentativeUserID string `json:"representative_user_id" gorm:"type:varchar(36);default:''"`
JoinedAt *time.Time `json:"joined_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Associations (not stored in database)
Organization *Organization `json:"organization,omitempty" gorm:"foreignKey:OrganizationID"`
User *User `json:"user,omitempty" gorm:"foreignKey:UserID"`
Organization *Organization `json:"organization,omitempty" gorm:"foreignKey:OrganizationID"`
RepresentativeUser *User `json:"representative_user,omitempty" gorm:"foreignKey:RepresentativeUserID"`
}
// TableName returns the table name for GORM
func (OrganizationMember) TableName() string {
return "organization_members"
func (OrganizationTenantMember) TableName() string {
return "organization_tenant_members"
}
// JoinRequestStatus represents the status of a join request