You are here

function _heartbeat_comments_node_delete_access in Heartbeat 6.4

Checks access to delete heartbeat node comment.

Parameters

$cid Integer Node comment ID:

1 string reference to '_heartbeat_comments_node_delete_access'
heartbeat_comments_menu in modules/heartbeat_comments/heartbeat_comments.module
Implementation of hook_menu().

File

modules/heartbeat_comments/heartbeat_comments.module, line 910
heartbeat_comments.module Heartbeat comments can come with two possible

Code

function _heartbeat_comments_node_delete_access($cid) {
  if (user_access('administer comments') || user_access('delete any comment')) {
    return TRUE;
  }
  else {
    global $user;
    $uid = db_result(db_query("SELECT uid FROM {comments} WHERE cid = %d ", $cid));
    return $uid == $user->uid && user_access('delete own comments');
  }
}