Skip to content

User in company space

Updated 13 Jul 2026jirkamotejl

User is the global identity. UserInCompanySpace is that identity’s membership in a concrete space. Most client operations are really about the membership, not the global user.

FieldValuesNote
rolestudent, admin, owner, participantPermission and product role in the space.
stateinvited, pending, active, revokedMembership lifecycle.

SETTABLE_STATES in code allows only active, revoked, and invited to be set directly. pending is an internal state and should be handled carefully.

  • UserInCompanySpace belongs to one CompanySpace.
  • It has an optional supervisor through supervisor.
  • It can belong to multiple UserGroup records.
  • It can be a group leader through a separate relation.
  • It has direct content assignments.
  • It has content licenses in the space.
  • It has participation sources explaining learning tasks.
  • Ordinary removal revokes the user; it does not delete the membership.
  • The model protects the last owner of a company space from revocation or role change.
  • destroy on UserInCompanySpace is intentionally discouraged and requires the explicit i_know_what_im_doing parameter.
  • Changing group membership can trigger learning-task recalculation.

When a client says “delete the user”, internally this often means “revoke the membership in the space”. Study and reporting history should remain preserved.