Problem/Motivation
When I am logged in as an administrator, I cannot access the Bean overview page. The error message is "Access denied, You are not authorized to access this page". My first step was to look at the permissions page and indeed the "Access the Bean overview page" was checked. So, I started to debug and run some traces.
In the bean.module, the hook_menu() entry is:
$items['admin/content/blocks'] = array(
'title' => 'Blocks',
'description' => 'Manage blocks used on your site.',
'page callback' => 'bean_list',
'access arguments' => array('access bean overview'),
'file' => 'includes/bean.pages.inc',
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
);
My assumption was 'access callback'
equaled 'user_access'
. Not so. When admin_views is enable, /admin/content is overridden and the 'views_access'
callback is used/inherited(?) instead. See the debug session below:
Disabling admin_views verified the use of 'user_access'
once again. I also tested this by leaving admin_views enabled and adding the following to the hook_menu() entry:
'access callback' => 'user_access',
again, all good.
Proposed resolution
My solution was to add a 'access callback'
to the hook_menu() entry.
$items['admin/content/blocks'] = array(
'title' => 'Blocks',
'description' => 'Manage blocks used on your site.',
'page callback' => 'bean_list',
'access callback' => 'user_access',
'access arguments' => array('access bean overview'),
'file' => 'includes/bean.pages.inc',
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
);
Remaining tasks
Post patch.- Review solution.
- If solution accepted, test patch.
- Merge into dev branch.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#1 | bean-cant-access-bean-overview-page-2369239-1.patch | 461 bytes | rojosnow |
cant-access-bean-overview-page-admin_views.jpg | 98.18 KB | rojosnow |
Comments
Comment #1
rojosnow CreditAttribution: rojosnow commentedComment #2
rojosnow CreditAttribution: rojosnow commented