getType() == 'secret' && !\Drupal::currentUser()->hasPermission('custom permission')) { return FALSE; } // For profiles other than the default profile grant access. if ($profile->getType() != 'main' && \Drupal::currentUser()->hasPermission('custom permission')) { return TRUE; } // In other cases do not alter access. return NULL; } /** * @} */