diff --git addresses.module addresses.module index e948545..59b3a9b 100755 --- addresses.module +++ addresses.module @@ -14,6 +14,7 @@ define('ADDRESSES_FIELD_NONE', 0); define('ADDRESSES_FIELD_SHOW', 1); define('ADDRESSES_FIELD_REQUIRED', 2); define('ADDRESSES_FIELD_HIDDEN', 3); +define('ADDRESSES_PERM_ADMIN', 'administer addresses'); /** * Implementation of hook_addressfieldapi(). @@ -199,7 +200,7 @@ function addresses_elements_process($element, $edit, $form_state, $form) { */ function addresses_menu() { $items['admin/settings/address'] = array( - 'access arguments' => array('access administration pages'), + 'access arguments' => array(ADDRESSES_PERM_ADMIN), 'description' => 'Settings for Address module', 'file' => 'addresses.settings.inc', 'page callback' => 'drupal_get_form', @@ -207,7 +208,7 @@ function addresses_menu() { 'title' => 'Addresses', ); $items['admin/settings/address/format'] = array( - 'access arguments' => array('access administration pages'), + 'access arguments' => array(ADDRESSES_PERM_ADMIN), 'description' => 'Format addresses', 'file' => 'addresses.settings.inc', 'page callback' => 'drupal_get_form', @@ -216,7 +217,7 @@ function addresses_menu() { 'type' => MENU_CALLBACK ); $items['admin/settings/address/autocomplete'] = array( - 'access callback' => TRUE, + 'access callback' => array(ADDRESSES_PERM_ADMIN), 'file' => 'addresses.settings.inc', 'page callback' => '_addresses_autocomplete', 'type' => MENU_CALLBACK @@ -226,6 +227,13 @@ function addresses_menu() { } /** + * Implementation of hook_perm() + */ +function addresses_perm(){ + return array(ADDRESSES_PERM_ADMIN); +} + +/** * Implementation of hook_theme(). */ function addresses_theme() {