synolia / sylius-gdpr-plugin
Synolia sylius GDPR plugin.
Installs: 31 717
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 13
Forks: 7
Open Issues: 4
Type:sylius-plugin
Requires
- php: ^7.4 || ^8.0
- phpdocumentor/reflection-docblock: ^5.3
- sylius/sylius: ^1.9
- symfony/property-info: ^5.4|^6.0
Requires (Dev)
- j13k/yaml-lint: 1.1.4
- php-parallel-lint/php-parallel-lint: 1.3.2
- phpmd/phpmd: 2.12.0
- phpro/grumphp: 1.13.0
- phpstan/extension-installer: 1.1.0
- phpstan/phpstan: 1.8.2
- phpstan/phpstan-doctrine: 1.3.11
- phpstan/phpstan-strict-rules: 1.3.0
- phpstan/phpstan-webmozart-assert: 1.2.0
- phpunit/phpunit: 9.5.21
- povils/phpmnd: 3.0.0
- seld/jsonlint: 1.9.0
- sylius-labs/coding-standard: 4.1.1
- symfony/browser-kit: 5.4.3
- symfony/debug-bundle: 5.4.3
- symfony/dotenv: 5.4.5
- symfony/intl: 5.4.10
- symfony/web-profiler-bundle: 5.4.10
- thecodingmachine/phpstan-strict-rules: 1.0.0
This package is auto-updated.
Last update: 2023-03-13 19:00:15 UTC
README
Sylius GDPR Plugin
Features
- Anonymize customer with the GDPR section in the admin customer show.
- Export customer data with the GDPR section in the admin customer show.
Click to see the anonymization configuration.
Click to see the export data configuration.
- Anonymize any entity with command for example :
php bin/console synolia:gdpr:anonymize --entity='Sylius\Component\Core\Model\Customer' --id=1
Use --help to get more informations
Requirements
Version | |
---|---|
PHP | ^8.0 |
Sylius | ^1.10 |
Installation
-
Add the bundle and dependencies in your composer.json :
composer require synolia/sylius-gdpr-plugin --no-scripts
-
Import required config in your
config/packages/_sylius.yaml
file:imports: - { resource: "@SynoliaSyliusGDPRPlugin/Resources/config/app/config.yaml" }
-
Import routing in your
config/routes.yaml
file:synolia_gdpr: resource: "@SynoliaSyliusGDPRPlugin/Resources/config/routes.yaml" prefix: '/%sylius_admin.path_name%'
-
Clear cache
php bin/console cache:clear
Add anonymization configuration
synolia_sylius_gdpr: disable_default_mappings: false # False by default anonymization: mappings: paths: - # Your\Paths\To\Mappings\Directory
Example of configuration
Sylius\Component\Core\Model\Address: # Your class path properties: firstName: faker: text # let's see => https://fakerphp.github.io/formatters/ args: [20] # The associated faker arguments prefix: 'anonymized-' lastName: value: 'Fake lastName' prefix: 'anonymized-'
Value can be null, an array, an int and a string
Add form in advanced actions page
There's two steps to add your custom form into the page:
- Override the controller service by setting the link of your FormType in the $formsType variable
Synolia\SyliusGDPRPlugin\Controller\AdvancedActionsController: arguments: $formsType: - 'Synolia\SyliusGDPRPlugin\Form\Type\Actions\AnonymizeCustomerNotLoggedSinceType' tags: ['controller.service_arguments']
- Then create your form processor by implementing Synolia\SyliusGDPRPlugin\Processor\AnonymizerProcessor\AdvancedActionsFormDataProcessorInterface
There a form processor example
Events
- Synolia\SyliusGDPRPlugin\Event\BeforeAnonymize
- Synolia\SyliusGDPRPlugin\Event\AfterAnonymize
- Synolia\SyliusGDPRPlugin\Event\BeforeCustomerAnonymize
- Synolia\SyliusGDPRPlugin\Event\AfterCustomerAnonymize
- Synolia\SyliusGDPRPlugin\Event\BeforeExportCustomerData
Development
See How to contribute.
License
This library is under the EUPL-1.2 license.
Credits
Developed by Synolia.