You are here

function comment_perm_administer_access in Comment Permissions 7.2

Same name and namespace in other branches
  1. 7 comment_perm.module \comment_perm_administer_access()

Determine access to administer comments for current node type.

Parameters

object $node: Node object.

Return value

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

5 calls to comment_perm_administer_access()
comment_perm_comment_presave in ./comment_perm.module
Implements hook_comment_presave().
comment_perm_comment_view_alter in ./comment_perm.module
Implements hook_comment_view_alter().
comment_perm_form_alter in ./comment_perm.module
Implements hook_form_alter().
comment_perm_form_comment_confirm_delete_alter in ./comment_perm.module
Implements hook_form_FORM_ID_alter().
comment_perm_node_view_alter in ./comment_perm.module
Implements hook_node_view_alter().

File

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

Code

function comment_perm_administer_access($node) {
  global $user;
  $admin_access = user_access("administer comments {$node->type}");
  if ($user->uid == $node->uid && $admin_access == FALSE) {
    $admin_access = user_access("administer comments own {$node->type}");
  }
  return $admin_access;
}