Document the features provided by CRM User. Relationship between one user and one Individual contact

Features

Display contact name as user display name.

admin/config/crm/user/list
3 different relationship views.

Optional event when a user is created. Event subscribers can control if and how a contact is created or linked.

Todo

Permissions to view/edit a user's contact (crm_user contact)

Issue fork crm-3524793

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bluegeek9 created an issue. See original summary.

bluegeek9’s picture

Issue summary: View changes
jdleonard’s picture

To discuss: how a Drupal User can manage multiple CRM Contacts and whether/how that relates to CRM User.

Best practice for security is one login (Drupal User) per human who needs to log in. I propose that we design against "organizational" Drupal User accounts.

In addition to tracking that a Drupal User and a CRM Contact represent the same human, we will eventually need a way for a Drupal User to manage any number of CRM Contacts for which they are authorized.

bluegeek9’s picture

Only individual contacts can be used with crm_user. There cannot be an organizational crm_user.

Access control of contacts is best handled with the group module.

Additional access control can be provided by something similar to node_access, crm_contact_access

bluegeek9’s picture

Issue summary: View changes
bluegeek9’s picture

bluegeek9’s picture

Should crm_user be revision-able?

If so, I assume we want a new revision every time the entity is saved.

Should the user reference field only be on the add form, and absent from the edit form? If so, then only the crm_contact reference need be revision-able.

jdleonard’s picture

The diagram linked in #6 didn't convey. Perhaps the wrong share link?

I would argue that changing an existing linkage (changing either the User referenced or the Contact referenced) would be a fairly infrequent action to take and it would be acceptable or perhaps even wise to require that the CRM User be deleted and a new one created. Thus I suggest that both those fields not be editable after creation. However, I think a read-only indication of the referenced User and Contact would be helpful context.

The current set of fields doesn't lead to any reason to "edit" a CRM User entity and thus I wouldn't think revisioning would make sense.

However, if there's a reason for CRM User to be fieldable, then I would argue that it should be revisionable to capture the history of whatever field values change.

jdleonard’s picture

jdleonard’s picture

If there's nothing to be edited (i.e. no reason to be fieldable) then I'd propose removing the "changed" field.

bluegeek9’s picture

I don't have a real use case for making the entity fieldable at the moment. I am thinking about custom event subscribers for when a user is created. The subscriber might need to store data there as part the create/look up.

Maybe it could be used to store a name format field; allow users to define their own Display name format. Yet, user_data is probably a better place to store the user's preference.

We should bring the fieldabilty to the group. They might have a reason to keep it fieldable

For being Editable, I am thinking about Organization logins. I do not like them, but there is nothing we can do about them. Users can only be mapped to a person/individual. So an admin might want to create a new contact and update the mapping when a different person takes over the account.

There is also the issue of duplicate contacts. When we build a de-duplicator/contact merger we might need to update the mapping as a result. I would prefer the merger have a bias for keeping contacts mapped to a user.

bluegeek9’s picture

jdleonard’s picture

Ugh, organization logins... I propose that we say that one needs to delete the existing mapping and create a new one.

It's possible a good use case for making User Contact fieldable comes along at a later date. If we were to make it fieldable in the future, it would simplify things to say that the Contact and User references cannot be changed (doing so could cause problems for future use cases' fields, which might assume this).

Merging...

I have encountered the following with my neighborhood association (ZNA) probably a dozen times:

  1. Someone new to ZNA pays dues on our payment processor's hosted form
  2. Zapier looks up the contact by email or, failing that, by exact name match in our accounting system, Xero (de facto CRM), and doesn't find them
  3. Zapier causes a contact to be created for this person in Xero
  4. The following year that person pays dues the same way but with a different email address (and slightly different name)
  5. Zapier causes a second contact to be created in Xero
  6. At some point I discover this and merge the contacts

In Drupal CRM / Member Platform, something similar could happen if the person isn't required to log in first (e.g. to optimize for collecting the dues), but in addition to the two Contacts (Contact A and Contact B), there could be two Users (User A and User B) and two User Contact mappings. At least one User Contact would need to be deleted. If the other one "needs" to be edited because the desired merge result is to keep User A and Contact B, I think we could adopt the same stance I propose for the organization login case: delete and re-create the User Contact entity.

In summary, I propose:

  • Not fieldable
  • Not editable
  • Not revisionable
  • Remove changed base field

Easy enough to re-add those things later.

bluegeek9’s picture

I think the entity is good enough for alpha releases. I think we should revisit this issue when we build the merger feature.

I think being revisionable is a good feature. If the entity is editable, there should be a changed field.

The entity is not fieldable. Anything that would be stored on the crm_user entity would probably be better stored in user_data.

bluegeek9’s picture

Title: Document CRM User » Document User<>Contact Mapping

I think we want add a feature to add contact name, and possible other fields to the user registration page.
The sitebuilder should be able to enable or disable in the settings.

jdleonard’s picture

For Member Platform, there was discussion of providing the ability to set each (Contact/Person) field as required/optional/hidden for each of A) user registering; B) user filling out a secondary registration form; and C) user editing their (Contact) profile. For editing, perhaps required/optional/disabled/hidden.

The "Secondary registration form" idea is about prompting the member for additional information after they provide the minimum information during registration. For example, only require email address for initial registration, but, once that's captured (and possibly after email is verified), require additional fields (e.g. name) to complete registration.

This would facilitate, for example, asking a member "What do you expect to get by joining this group?" during (secondary?) registration, but not exposing it to them thereafter. Or not letting them edit their name after registration.

  • bluegeek9 committed e67d2ddf on 1.0.x
    Issue #3524793: Document User<>Contact Mapping
    
bluegeek9’s picture

Status: Active » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM as a favorite on the project page to help others discover it and show your support.
bluegeek9’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.