Personal data destruction plugin implementation classes

In the base configuration of ContactManager, the ABPersonalDataDestructionSafePlugin class is registered as the class that implements the PersonalDataDestruction plugin interface. This class provides default handling for destruction of pinnable root entities in the base configuration. It prevents destruction of any personal data.

ABPersonalDataDestructionSamplePlugin is the class you can use as an example when you implement your own personal data destruction class to define both getDestroyer and how specific pinnable roots are handled. You must then register your implementation class with the plugin registry PersonalDataDestruction.gwp.

These two classes define methods that control destruction of pinnable root entities by returning one of the values defined in the enum PersonalDataDisposition:

  • MUST_NOT_DESTROY – The object must not be destroyed. If this value is in conflict with a MUST_DESTROY value in the domain graph, the Data Protection Officer must get involved.
  • MUST_DESTROY – The object must be destroyed.
  • MAY_DESTROY – The object can be destroyed.

ABPersonalDataDestructionSafePlugin

In the base configuration, ABPersonalDataDestructionSafePlugin calls getDestroyer to obtain the destroyer defined in ABPersonalDataDestroyer. Additionally, this class prevents data destruction by returning MUST_NOT_DESTROY for all calls to destroy pinnable root entities. For example:

override function shouldDestroyRoot(
    root: DestructionRootPinnable, 
    descendants: Collection<DestructionRootPinnable>, 
    origin: DestructionRootPinnable): PersonalDataDisposition 
{
  notifyDataProtectionOfficer(
        root, "Safe plugin implementation always returns MUST_NOT_DESTROY")
  return MUST_NOT_DESTROY
}
override function shouldDestroyUser(
    userContact: UserContact): PersonalDataDisposition 
{ 
  notifyDataProtectionOfficer(
        userContact, "Safe plugin implementation always returns MUST_NOT_DESTROY")
  return MUST_NOT_DESTROY
}
private function notifyDataProtectionOfficer(
    contact : DestructionRootPinnable, message : String) 
{
  notifyDataProtectionOfficer(contact, null, message, null)
}
override function notifyDataProtectionOfficer(
    root: DestructionRootPinnable, title: String, message: String, dateOfError: Date) 
{
  ABPersonalDataLogUtil.logInfoNotDestroyed(root, message)
}

ABPersonalDataDestructionSamplePlugin

You can use the class ABPersonalDataDestructionSamplePlugin as a guide for writing your own personal data destruction code. This class can return values other than MUST_NOT_DESTROY for a pinnable root entity.

The class returns MUST_NOT_DESTROY in the following circumstances:

  • The contact is an ABContact with DoNotDestroy set to true.
  • The subtype of the contact is ABCompany or ABPlace.
  • Core applications were checked for permission to destroy the contact, and at least one application did not permit the destruction.

The class returns MUST_DESTROY if the contact:

  • Is an ABContact for which DoNotDestroy is false, the subtype is not ABCompany or ABPlace, and all core applications permit destruction of the contact.
  • Is a UserContact.

See also