You are here

function override_node_options_perm in Override Node Options 5

Same name and namespace in other branches
  1. 6 override_node_options.module \override_node_options_perm()

Implements hook_perm().

File

./override_node_options.module, line 12
Allow users to override the default publishing options for nodes they can edit without giving them the 'administer nodes' permission.

Code

function override_node_options_perm() {
  $node_types = array_keys(node_get_types('names'));
  foreach ($node_types as $node_type) {
    $node_type = check_plain($node_type);
    $perms[] = 'override ' . $node_type . ' published option';
    $perms[] = 'override ' . $node_type . ' promote to front page option';
    $perms[] = 'override ' . $node_type . ' sticky option';
    $perms[] = 'override ' . $node_type . ' revision option';
    $perms[] = 'override ' . $node_type . ' authored on option';
    $perms[] = 'override ' . $node_type . ' authored by option';
  }
  return $perms;
}