You are here

public static function LearningPathAccess::requiredValidation in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x src/LearningPathAccess.php \Drupal\opigno_learning_path\LearningPathAccess::requiredValidation()

Returns group required validation.

6 calls to LearningPathAccess::requiredValidation()
DefaultTwigExtension::get_join_group_link in src/TwigExtension/DefaultTwigExtension.php
Returns join group link.
DefaultTwigExtension::get_start_link in src/TwigExtension/DefaultTwigExtension.php
Returns group start link.
LearningPathAccess::mergeUserStatus in src/LearningPathAccess.php
Merges Learning Path group user status.
LearningPathAccess::statusGroupValidation in src/LearningPathAccess.php
Returns group user access flag in validation condition.
opigno_learning_path_entity_presave in ./opigno_learning_path.module
Implements hook_entity_presave().

... See full list

File

src/LearningPathAccess.php, line 83

Class

LearningPathAccess
Class LearningPathAccess.

Namespace

Drupal\opigno_learning_path

Code

public static function requiredValidation(Group $group, $account = FALSE) {
  if (!$account) {
    $account = \Drupal::currentUser();
  }

  // Check if we need to wait validation.
  $validation = FALSE;
  if ($group
    ->get('field_requires_validation')->value && !$account
    ->hasPermission('bypass group validation requirement')) {
    $validation = TRUE;
  }
  return $validation;
}