You are here

function filter_harmonizer_debug_flag in Views Filter Harmonizer 7

Return whether dubug info messages are requested for the current user's role.

Return value

bool TRUE if the current role may see information/debug messages.

2 calls to filter_harmonizer_debug_flag()
filter_harmonizer_views_exposed_form_submit in ./filter_harmonizer.module
Supplementary submit handler for 'views_exposed_form'.
filter_harmonizer_views_ui_config_item_form_submit in ./filter_harmonizer.module
Supplementary submit handler for the form 'views_ui_config_item_form'.

File

./filter_harmonizer.module, line 635
filter_harmonizer.module For Views where both exposed and contextual filters are active on a page.

Code

function filter_harmonizer_debug_flag() {
  global $user;

  // Cannot use user_access() for uid==1 as it will always return TRUE.
  foreach (user_role_permissions($user->roles) as $role_permissions) {
    if (in_array('filter harmonizer view info msgs', array_keys($role_permissions))) {
      return TRUE;
    }
  }
  return FALSE;
}