You are here

function message_show_message_access in Message 6

1 call to message_show_message_access()
message_show_message in ./message.module
Show a message by the message instance ID.

File

./message.module, line 567
API functions to manipulate messages.

Code

function message_show_message_access($plugin, $message_instance, $realm_ids = array(), $account = NULL) {
  $return = FALSE;
  if (!empty($plugin['realm'])) {
    if (empty($realm_ids)) {
      $realms = message_realm_load_multiple_by_message($message_instance->iid);
      $realm_ids = !empty($realms[$plugin['realm']]) ? $realms[$plugin['realm']] : array();
    }
    if ($realm_ids) {
      if (empty($account)) {
        global $user;
        $account = drupal_clone($user);
      }
      $return = call_user_func($plugin['access']['access callback'], $plugin, $message_instance, $realm_ids, $account);
    }
  }
  return $return;
}