function overlay_user_dismiss_message_access

Access callback: Determines access to dismiss the accessibility message.

Return value

TRUE if the user has permission to dismiss the accessibility message or if the user is anonymous. FALSE if otherwise.

See also

overlay_user_dismiss_message()

overlay_menu()

1 string reference to 'overlay_user_dismiss_message_access'
overlay_menu in drupal/core/modules/overlay/overlay.module
Implements hook_menu()

File

drupal/core/modules/overlay/overlay.module, line 259
Displays the Drupal administration interface in an overlay.

Code

function overlay_user_dismiss_message_access() {
  global $user;
  if (!user_access('access overlay')) {
    return FALSE;
  }

  // It's unlikely, but possible that "access overlay" permission is granted to
  // the anonymous role. In this case, we do not display the message to disable
  // the overlay, so there is nothing to dismiss.
  if (empty($user->uid)) {
    return FALSE;
  }
  return TRUE;
}