Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flarum/gdpr
Gdpr extension for @flarum
https://github.com/flarum/gdpr
Last synced: 3 months ago
JSON representation
Gdpr extension for @flarum
- Host: GitHub
- URL: https://github.com/flarum/gdpr
- Owner: flarum
- License: mit
- Created: 2020-07-23T10:46:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T15:15:43.000Z (9 months ago)
- Last Synced: 2024-04-14T01:14:34.242Z (7 months ago)
- Language: PHP
- Size: 628 KB
- Stars: 11
- Watchers: 8
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-flarum - Flarum GDPR
README
# GDPR or PII management
This extension allows users increasing control over their data.
### Requirements
- `flarum/core` - `v1.8.3` or higher
- `PHP` - `8.0` or higher### Installation or update
Install manually with composer:
```sh
composer require blomstra/gdpr:@beta
```### Use
All forum users now have a `Personal Data` section within their account settings page:
![image](https://github.com/blomstra/flarum-ext-gdpr/assets/16573496/4e469956-709f-4ba3-a5fe-d3fcb0401b73)
From here, users may self-service export their data from the forum, or start an erasure request. Erasure requests are queued up for admins/moderators to process. Any unprocessed requests that are still pending after 30 days will be processed automatically using the configured default method (Deletion or Anonymization).
#### Specifying which queue to use
If your forum runs multiple queues, ie `low` and `high`, you may specify which queue jobs for this extension are run on in your skeleton's `extend.php` file:```php
Blomstra\Gdpr\Jobs\GdprJob::$onQueue = 'low';return [
... your current extenders,
];
```### For developers
You can easily register a new Data type, remove an existing Data type, or exclude specific columns from the user table during export by leveraging the `Blomstra\Gdpr\Extend\UserData` extender. Ensure that you wrap the GDPR extender in a conditional extend, so that forum owners can choose if they want to enable GDPR functionality or not. This functionality requires `flarum/core` `v1.8.3` or higher, so that should be set as your extension's minimum requirement.
#### Registering a new Data Type:
Your data type class should implement the `Blomstra\Gdpr\Contracts\DataType`:
```php
whenExtensionEnabled('blomstra-gdpr', fn () => [
(new UserData())
->addType(Your\Own\DataType::class),... other conditional extenders as required ...
]),
];
```The implementation you create needs a export method, it will receive a ZipArchive resource.
You can use that to add any strings or actual files to the archive. Make sure to properly
name the file and always prefix it with your extension slug (blomstra-something-filename).#### Removing a Data Type:
If for any reason you want to exclude a certain DataType from the export:
```php
use Blomstra\Gdpr\Extend\UserData;
use Flarum\Extend;return [
(new Extend\Conditional())
->whenExtensionEnabled('blomstra-gdpr', fn () => [
(new UserData())
->removeType(Your\Own\DataType::class),... other conditional extenders as required ...
]),
];
```#### Exclude specific columns from the user table during export:
```php
use Blomstra\Gdpr\Extend\UserData;return [
(new Extend\Conditional())
->whenExtensionEnabled('blomstra-gdpr', fn () => [
(new UserData())
->removeUserColumn('column_name') // For a single column
->removeUserColumns(['column1', 'column2']), // For multiple columns... other conditional extenders as required ...
]),
];
```
### Flarum extensionsThese are the known extensions which offer GDPR data integration with this extension. Don't see a required extension listed? Contact the author to request it
- [2FA](https://github.com/imorland/flarum-ext-twofactor), since `1.0.9`
- [Boring Avatars](https://github.com/imorland/flarum-ext-boring-avatars), since `1.0.0`
- [FoF Ban IPs](https://github.com/FriendsOfFlarum/ban-ips), since `1.1.0`
- [FoF Drafts](https://github.com/FriendsOfFlarum/drafts), since `1.2.8`
- [FoF Follow Tags](https://github.com/FriendsOfFlarum/follow-tags), since `1.2.2`
- [FoF Terms](https://github.com/FriendsOfFlarum/terms), since `1.3.0`
- [FoF Upload](https://github.com/FriendsOfFlarum/upload), since `1.4.4`
- [Follow Users](https://github.com/imorland/follow-users), since `1.4.1`### FAQ & Recommendations
- Generating the zip archive can be pushed to [queue functionality](https://extiverse.com/?filter[q]=queue). This is exceptionally important on larger communities and with more extensions that work with the gdpr extension to allow data exports.