You are here

public function SocialTourController::onboardingEnabled in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  2. 8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  3. 8.2 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  4. 8.3 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  5. 8.4 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  6. 8.5 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  7. 8.6 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  8. 8.7 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  9. 8.8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  10. 10.3.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  11. 10.0.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()
  12. 10.1.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::onboardingEnabled()

Check if onboarding is enabled.

Return value

bool Returns either TRUE or FALSE.

File

modules/custom/social_tour/src/SocialTourController.php, line 100

Class

SocialTourController
Class SocialTourController.

Namespace

Drupal\social_tour

Code

public function onboardingEnabled() {

  // Check if tour is enabled by SM setting.
  if (!$this->configFactory
    ->get('social_tour_enabled')) {
    return FALSE;
  }

  // Check permissions.
  if (!$this->currentUser
    ->hasPermission('access tour')) {
    return FALSE;
  }

  // Check if current disabled it.
  if ($this->userData
    ->get('social_tour', $this->currentUser
    ->id(), 'onboarding_disabled')) {
    return FALSE;
  }
  return TRUE;
}