hasgeek / lastuser

Lastuser has been merged into Funnel. This repository is archived.
https://hasgeek.com/
BSD 2-Clause "Simplified" License
166 stars 30 forks source link

Disambiguate authorship from ownership #216

Closed jace closed 6 years ago

jace commented 7 years ago

Lastuser (and most HasGeek apps) currently use the user_id column to refer to the user who owns the given object.

With the move to principals in #91, we need to disambiguate ownership (any principal can be an owner) from authorship (only a user can be an author as teams and organizations are non-human).

Proposal:

  1. Reduce the scope of the user_id column to only refer to authorship. It continues to point to a User instance.
  2. Where the possibility of ownership by a non-human exists (almost everywhere), add a principal_id column that refers to the Principal.
  3. When adding functionality to convert a User account into an Organization account (ticket pending), the split process (reverse of the current merge_users) should preserve the user_id column while changing the value of the principal_id column.

Alternative proposal: using user_id and principal_id leaves some ambiguity on which is for what. Use the new column names author_id and owner_id instead.

jace commented 6 years ago

This is no longer relevant to Lastuser as we are removing functionality here, and Principal will not be implemented. Perhaps the only relevance is for clients, to track which user created a client. However, that too is in question as clients will be mandatorily owned by users when #232 is implemented.