Skip to content
Snippets Groups Projects

Make role load conditional upon authenticated role

1 unresolved thread

Closes #3373921

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
13 14 */
14 15 function google_analytics_install() {
15 16 // Make the default install more user and GDPR friendly.
16 $role = Role::load('authenticated');
17 $role->grantPermission('opt-in or out of google analytics tracking');
18 $success = $role->save();
19 if ($success) {
20 $messenger = \Drupal::messenger();
21 $messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Google Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status');
17 if ($role = Role::load(AccountInterface::AUTHENTICATED_ROLE)) {
  • Dezső Biczó added 1 commit

    added 1 commit

    • 6a7840c0 - Bail out if config sycnhing is running

    Compare with previous version

  • Jakob P added 6 commits

    added 6 commits

    • 6a7840c0...0c0e0691 - 5 commits from branch project:4.x
    • 84c1d635 - Merge branch google_analytics:4.x into 3373921-cannot-install-from

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading