Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On a site with multiple roles, this module grants any user who has permission to access any administrative page the power to change the module's configuration. ("Content types available in archive").
This is Not Good, as forum aides (for example) can muck up the system.
Just a few lines to add "administer archive settings:"
/**
* Implementation of hook_menu().
*/
function archive_menu() {
$items = array();
$items['archive'] = array(
'title' => 'Archives',
'access arguments' => array('access content'),
'page callback' => 'archive_page',
'file' => 'archive.pages.inc',
'type' => MENU_SUGGESTED_ITEM
);
$items['admin/settings/archive'] = array(
'title' => 'Archives',
'description' => 'Select the content types listed in the archives.',
'access arguments' => array('administer archive settings'), // ADD THIS LINE
'page callback' => 'drupal_get_form',
'page arguments' => array('archive_admin_settings'),
'file' => 'archive.admin.inc',
'type' => MENU_NORMAL_ITEM
);
return $items;
}
/**
* Implementation of hook_perm // ADD THIS FUNCTION
*/
function archive_perm() {
return array('administer archive settings');
}
Comments
Comment #1
manos_ws CreditAttribution: manos_ws commentedFor D7 change the line 44
from
to
and add the function
Comment #2
arroyot24 CreditAttribution: arroyot24 commentedIt worked perfectly for us.
Thank you very much!