Commit 9516a0a0 authored by Alexander Hass's avatar Alexander Hass
Browse files

Make the default install more user and GDPR friendly.

parent 109f69b2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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().