Closed jace closed 6 years ago
This scheme doesn't work at all for a mobile number-based UX. We'll need a manual Organization and Team definition process for that UX.
For point 7, the python-whois library seems useful and up-to-date.
TeamEmail
can be a principal as described in #91. In fact, if UserEmail
(as last modified in #125) switches ownership to the Principal
model, then the TeamEmail
model is unnecessary. It can simply be a flag or a foreign key on the Team
model linking back to the UserEmail
model, locking it to that email address and switching on team membership semantics.
mxsniff
now offers email probes, as discussed in #178.
Deprecated by #232. This should be a client app concern.
The
Organization
andTeam
models currently require someone to explicitly create them and manage their memberships. This a tedious and non-intuitive process. Hasjob, however, has shown us that organization affiliations can be deduced automatically from the email domain.Lastuser has a half-baked version of this idea from #108 where
Team
has an associated domain and anyone with a matching email address is automatically added to it (and by extension, to theOrganization
).It may help to invert this model to be completely bottom up:
TeamEmail
that represents a shared email address. Anyone who can prove ability to receive at this address becomes a member of the team. Verification codes sent here are time-bound (use within 24 hours) but not use count-bound (more than one user can verify access).TeamEmail
complementsUserEmail
, which can now lose theteam_id
column and associated check constraint (introduced in #125).TeamEmail
andUserEmail
shareemail
field namespace, so the same email can't be used in both places.TeamEmail
, but does not delete theTeamEmail
to preserve referential integrity. Related: #135.UserEmail
orTeamEmail
as appropriate. It's unclear how to switch an existing instance, however (separate ticket required).Domain
orOrganizationDomain
model similar to Hasjob'sDomain
model that is automatically constructed fromTeamEmail
. This model shares username namespace with the existingOrganization
andUser
models, which need to be updated to recognise it. This model also tracks itsname
anddomain
in separate fields, unlike Hasjob'sDomain
model.Domain
has no owners. Rather, anyone who belongs to one of its teams can edit the domain (setname
andtitle
fields but notdomain
). Optional: owning an email address present in the WHOIS record should also be valid, assuming we can query and cache that efficiently.Domain
has one or more special teams (recipients ofabuse@
orpostmaster@
, maybe other special emails), it's considered a "claimed" domain and only these team members have owner access.Domain
can assign or removeadmin
and other roles, allowing anyone else with those roles to also have rights.Finally, we need to consider how
Team
andTeamEmail
, andOrganization
andDomain
can co-exist and perhaps be the same objects.