You are here

function _heartbeat_message_delete_access in Heartbeat 6.4

Same name and namespace in other branches
  1. 7 heartbeat.module \_heartbeat_message_delete_access()

Helper function to check if a user has access to delete a message

2 calls to _heartbeat_message_delete_access()
heartbeat_activity_delete_action in views/heartbeat_views.module
Views bulk operations callback to delete multiple activity.
views_handler_field_heartbeat_activity_link_delete::render in views/handlers/views_handler_field_heartbeat_activity_link_delete.inc
1 string reference to '_heartbeat_message_delete_access'
heartbeat_menu in ./heartbeat.module
Implementation of hook_menu().

File

./heartbeat.common.inc, line 124
Commonly functions used in heartbeat

Code

function _heartbeat_message_delete_access($uaid) {
  if (_heartbeat_activity_stream_delete_access()) {
    return TRUE;
  }
  if (variable_get('heartbeat_activity_stream_actor_delete', 1)) {
    global $user;
    $uid = db_result(db_query("SELECT uid FROM {heartbeat_activity} WHERE uaid = %d", $uaid));
    return $uid == $user->uid;
  }
  return FALSE;
}