You are here

function custom_pub_permission in Custom Publishing Options 7

Implements hook_permission().

We use these permissions on the individual elements in the node_form via the #access parameter. So in order to use the elements you must add the permissions to a role.

File

./custom_pub.module, line 26
Adds the ability to add Custom publishing options to the node Add/Edit forms.

Code

function custom_pub_permission() {
  $permissions = array();
  $types = variable_get('custom_pub_types', array());
  foreach ($types as $type) {
    $key = 'edit_custom_pub_' . $type['type'];
    $permissions[$key] = array(
      'title' => 'Can access/use ' . t('%type', array(
        '%type' => $type['type'],
      )) . ' custom publishing option on node forms',
    );
  }
  return $permissions;
}