You are here

function search_config_get_access in Search configuration 8

Same name and namespace in other branches
  1. 7 search_config.module \search_config_get_access()

Helper function to test the users configured access rights to a field.

1 call to search_config_get_access()
_search_config_advanced_form in ./search_config.node.inc
This function implements the options to configure the default Drupal search form, including type filter, field visibility, form visibility, etc.

File

./search_config.module, line 692
The module that search form, including enforcing search restrictions by content type.

Code

function search_config_get_access($remove, $grant) {
  $user = \Drupal::currentUser();
  if ($remove) {
    return (bool) array_intersect_key($user
      ->getRoles(), array_filter($grant));
  }
  return TRUE;
}