You are here

function opigno_learning_path_user_create_access in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x opigno_learning_path.module \opigno_learning_path_user_create_access()

Implements hook_ENTITY_TYPE_create_access().

File

./opigno_learning_path.module, line 2024
Contains opigno_learning_path.module.

Code

function opigno_learning_path_user_create_access(AccountInterface $account, array $context, $entity_bundle) {
  if ($account
    ->hasPermission('manage group members in any group')) {

    // Allow platform-level user managers to create new users.
    return AccessResult::allowed();
  }
  return AccessResult::neutral();
}