[D7] Allow access to admin/reports based on the 'access administration pages' permission

Created on 4 June 2016, about 8 years ago
Updated 20 April 2024, about 2 months ago

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

📌 Task
Status

Postponed

Version

7.0 ⚰️

Component
System 

Last updated 1 day ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024