You are here

function comment_perm_skip_approval_access in Comment Permissions 7.2

Determine access to post comments without approval for current node type.

Parameters

object $node: Node object.

Return value

bool TRUE - Current node type has permission access, FALSE otherwise.

1 call to comment_perm_skip_approval_access()
comment_perm_comment_presave in ./comment_perm.module
Implements hook_comment_presave().

File

./comment_perm.module, line 301
Control commenting permissions by role and by node type.

Code

function comment_perm_skip_approval_access($node) {
  global $user;
  $skip_app_access = user_access("skip comment approval {$node->type}");
  if ($user->uid == $node->uid && $skip_app_access == FALSE) {
    $skip_app_access = user_access("skip comment approval own {$node->type}");
  }
  return $skip_app_access;
}