diff --git a/defaultcontent.module b/defaultcontent.module index ddc2256..97cd46b 100644 --- a/defaultcontent.module +++ b/defaultcontent.module @@ -51,7 +51,7 @@ function defaultcontent_node_update($node) { * TODO: get the machine_name type to work */ function defaultcontent_form_alter(&$form, &$form_state, $form_id) { - if(strpos($form_id, "node_form")) { + if (user_access('edit node machine name') && strpos($form_id, "node_form")) { $form['machine_name_fs'] = array( '#type' => 'fieldset', '#title'=> 'Machine Name', @@ -101,6 +101,15 @@ function defaultcontent_page_view($name) { drupal_not_found() ; } +/** + * Implements hook_permission(). + */ +function defaultcontent_permission() { + return array('edit node machine name' => array( + 'title' => t('Edit node machine name'), + 'description' => t('Allow user to edit the machine name associated with a node.'), + )); +} /* * implementation of hook_cron