nordcode.io / sylius-erase-personal-data-plugin
Erase personal data plugin for Sylius.
Requires
- php: ^7.2
- sylius/sylius: ^1.6
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^5.0
- phpstan/phpstan-doctrine: ^0.11
- phpstan/phpstan-shim: ^0.11
- phpstan/phpstan-webmozart-assert: ^0.11
- phpunit/phpunit: ^8.0
- sensiolabs/security-checker: ^5.0
- sylius-labs/coding-standard: ^3.0
- symfony/browser-kit: ^3.4|^4.3
- symfony/debug-bundle: ^3.4|^4.3
- symfony/dotenv: ^4.3
- symfony/intl: ^3.4|^4.3
- symfony/web-profiler-bundle: ^3.4|^4.3
- symfony/web-server-bundle: ^3.4|^4.3
This package is not auto-updated.
Last update: 2024-05-07 06:48:52 UTC
README
This plugin allows customers to request their personal data to be erased from a Sylius store, and for the store administrator to do this.
Installation
- Install the package via composer:
$ composer require nordcode.io/sylius-erase-personal-data-plugin
Update
config/bundles.php
:<?php return [ ... Nordcode\SyliusErasePersonalDataPlugin\NordcodeSyliusErasePersonalDataPlugin::class => ['all' => true], ]
Update your
Customer
model class to implement ourCustomerInterface
:... use Nordcode\SyliusErasePersonalDataPlugin\Entity\CustomerInterface; use Nordcode\SyliusErasePersonalDataPlugin\Entity\CustomerTrait; ... class Customer extends BaseCustomer implements CustomerInterface { use CustomerTrait; ... }
Include plugin routes in your route configuration (e.g.
config/routes.yaml
):nordcode_erase_personal_data_admin: resource: "@NordcodeSyliusErasePersonalDataPlugin/Resources/config/admin_routing.yaml" prefix: /admin nordcode_erase_personal_data_shop: resource: "@NordcodeSyliusErasePersonalDataPlugin/Resources/config/shop_routing.yaml"
- Copy and execute the migrations from
src/Migrations/
:$ cp vendor/nordcode.io/sylius-erase-personal-data-plugin/src/Migrations/* src/Migrations/ $ bin/console doctrine:migrations:migrate
Note: If you are running it on production, add the
-e prod
flag to this command.
Usage
Note: When erasing personal data, an attempt will be made to delete the customer and their respective user altogether.
The plugin adds a new route for customers to request their data to be removed. How this is handled is configurable: either all data may be erased immediately, or the newly added erasureRequestedAt
field updated to current timestamp.
Also an admin route is added, which allows the store administrator to erase customer's personal data when necessary. This may be done from customer's profile page. In addition, the customer grid is extended with an additional column and filter.
Erasure is done in steps and it's possible to hook to each step, or even cancel it entirely. Have a look at src/Services/PersonalDataEraser.php
and the src/Event/*
to see how it works.