Problem/Motivation
I need to allow a webmaster to access /admin/reports/linkchecker
. In linkchecker module I have added a permission Access broken links report
to allow this. This is not security releated...
But now this webmaster role must have no permission to 'access site reports' and I do not like to provide this to the webmasters as the 'access site reports' permission has security implications... per help text.
Why is the top level Reports
menu not shown if there is a menu point below where the user has access permission? How can this implemented?
I have seen this works well with /admin/structure/contact
as a compareable example.
Other broken permissions are:
- Statistics not visible, but accessible if I know the path
- 'Field list' not visible, but accessible if I know the path
- 'Rebuild permissions' not visible, but accessible if I know the path
- 'Status report' not visible, but accessible if I know the path
Proposed resolution
Change 'access arguments' to 'access administration pages' on top level menu item. This will enable the Reports menu if I have access to any of the submenus (expected behaiviour).
$items['admin/reports'] = array(
'title' => 'Reports',
'description' => 'View reports, updates, and errors.',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('access administration pages'),
'weight' => 5,
'position' => 'left',
'file' => 'system.admin.inc',
);
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None