Split inactive profile state
Replace the binary profile ACTIVE/INACTIVE model with PENDING, ACTIVE, and DEACTIVATED so invited-but-not-yet-activated members remain assignable to assets, data, and risks instead of being treated like deactivated users. Add activated_at/deactivated_at timestamps and Mark* lifecycle helpers, and update every transition (create, invite/re-invite, activation, archive, SCIM, SAML, sessions, compliance-portal grant) to the new states. Expose a multi-state states[] filter across coredata, GraphQL, MCP, and the console owner pickers, which now request ACTIVE and PENDING members. A migration renames the membership_state enum, classifies existing inactive profiles as PENDING from recent invitation activity, and backfills the new timestamp columns. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -364,7 +364,7 @@ func (s SessionService) OpenPasswordChildSessionForOrganization(
|
||||
return fmt.Errorf("cannot load profile: %w", err)
|
||||
}
|
||||
|
||||
if profile.State == coredata.ProfileStateInactive {
|
||||
if profile.State == coredata.ProfileStateDeactivated {
|
||||
return NewUserInactiveError(profile.ID)
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ func (s SessionService) OpenSAMLChildSessionForOrganization(
|
||||
return fmt.Errorf("cannot load profile: %w", err)
|
||||
}
|
||||
|
||||
if profile.State == coredata.ProfileStateInactive {
|
||||
if profile.State == coredata.ProfileStateDeactivated {
|
||||
return NewUserInactiveError(profile.ID)
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ func (s SessionService) OpenOIDCChildSessionForOrganization(
|
||||
return fmt.Errorf("cannot load profile: %w", err)
|
||||
}
|
||||
|
||||
if profile.State == coredata.ProfileStateInactive {
|
||||
if profile.State == coredata.ProfileStateDeactivated {
|
||||
return NewUserInactiveError(profile.ID)
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ func (s SessionService) AssumeOrganizationSession(
|
||||
return fmt.Errorf("cannot load profile: %w", err)
|
||||
}
|
||||
|
||||
if profile.State == coredata.ProfileStateInactive {
|
||||
if profile.State == coredata.ProfileStateDeactivated {
|
||||
return NewUserInactiveError(profile.ID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user