Commit 9516a0a0 authored by hass's avatar hass

Make the default install more user and GDPR friendly.

parent 109f69b2
......@@ -6,6 +6,20 @@
*/
use Drupal\Core\Url;
use Drupal\user\Entity\Role;
/**
* Implements hook_install().
*/
function google_analytics_install() {
// Make the default install more user and GDPR friendly.
$role = Role::load('authenticated');
$role->grantPermission('opt-in or out of matomo tracking');
$success = $role->save();
if ($success) {
drupal_set_message(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Matomo Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status');
}
}
/**
* Implements hook_uninstall().
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment