You are here

function exclude_node_title_check_perm in Exclude Node Title 7

Same name and namespace in other branches
  1. 8 exclude_node_title.module \exclude_node_title_check_perm()
  2. 6 exclude_node_title.module \exclude_node_title_check_perm()

Check permission to change node title exclusion.

3 calls to exclude_node_title_check_perm()
exclude_node_title_form_alter in ./exclude_node_title.module
Implements hook_form_alter().
exclude_node_title_node_insert in ./exclude_node_title.module
Implements hook_node_insert().
exclude_node_title_node_update in ./exclude_node_title.module
Implements hook_node_update().

File

./exclude_node_title.module, line 169
Primarily Drupal hooks and global API functions to exclude node titles.

Code

function exclude_node_title_check_perm($node) {
  global $user;
  if (user_access('exclude any node title')) {
    return TRUE;
  }
  if (!user_access('exclude own node title')) {
    return FALSE;
  }
  return !strcmp($node->name, $user->name);
}