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

Inferred vs explicit principals #220

Closed jace closed 5 years ago

jace commented 7 years ago

The three principals (#91), User, Organization and Team are explicitly defined by the act of a user registering an account and creating orgs and teams.

However, it is also possible for the existence of these principals to be inferred from other data. Inferred principals show up as a recurring pattern:

  1. We may encounter a new User first via their email address or phone number, such as via a mailing list subscription, or a guest checkout in an online purchase.
  2. Hasjob has an inferred Organization via the Domain model guessed from an email address. Discussion in hasgeek/hasjob#141.
  3. Lastuser has a copy of this idea in #185 (inverted, email-backed teams and organizations).
  4. Hasjob also has an inferred Team guessed from the collaborators on a job post. Discussion in hasgeek/hasjob#375.
  5. Boxoffice similarly has inferred organizations and teams that show up in purchase orders. Organization-wide discounts need to be calculated on the basis of these inferred organizations (again using email domain for now).

Inferred principals aren't explicit data. They are metadata on other types of data within each app. They are best understood as queries or views rather than explicit models. While an explicit model may exist such as Hasjob's Domain, these are for convenience and classify as app data, not user data. Hasjob's domains cannot be renamed or deleted, for instance. A qualifying user may submit additional data such as a title (the organization's name), but will not own the inferred principal's record.

Inferred principals allow a user access to data they are authorised to own or edit, without requiring an explicit grant of that authority. Lastuser should provide guidelines on how inferred principals may be identified and related data placed under the authority of explicit principals.

jace commented 6 years ago

In hasgeek/coaster#157, a new concept "anchor" is introduced, and inferred principals are discovered as a chain of activity linking anchors.

jace commented 5 years ago

We will not be implementing this in Lastuser. It should be a concern of the primary client app.