Helper function to generate standard node permission list for a given type.
$name: The machine name of the node type.
array An array of permission names and descriptions.
function node_list_permissions($type) {
// Build standard list of node permissions for this type.
$perms = array(
"create {$type->type} content" => array(
'title' => t('%type_name: Create new content', array(
'%type_name' => $type->name,
)),
),
"edit own {$type->type} content" => array(
'title' => t('%type_name: Edit own content', array(
'%type_name' => $type->name,
)),
),
"edit any {$type->type} content" => array(
'title' => t('%type_name: Edit any content', array(
'%type_name' => $type->name,
)),
),
"delete own {$type->type} content" => array(
'title' => t('%type_name: Delete own content', array(
'%type_name' => $type->name,
)),
),
"delete any {$type->type} content" => array(
'title' => t('%type_name: Delete any content', array(
'%type_name' => $type->name,
)),
),
"view {$type->type} revisions" => array(
'title' => t('%type_name: View revisions', array(
'%type_name' => $type->name,
)),
),
"revert {$type->type} revisions" => array(
'title' => t('%type_name: Revert revisions', array(
'%type_name' => $type->name,
)),
'description' => t('Role requires permission <em>view revisions</em> and <em>edit rights</em> for nodes in question, or <em>administer nodes</em>.'),
),
"delete {$type->type} revisions" => array(
'title' => t('%type_name: Delete revisions', array(
'%type_name' => $type->name,
)),
'description' => t('Role requires permission to <em>view revisions</em> and <em>delete rights</em> for nodes in question, or <em>administer nodes</em>.'),
),
);
return $perms;
}