1

I have created a page using hook_menu for "employee" role using the code below:

 $items['admin/employee'] = array(
    'title' => 'Dashboard - Employee',
    'page callback' => 'employee_page',
    'access arguments' => array('Access administration theme'),
    'type' => MENU_NORMAL_ITEM,
);

When this page is viewed by an employee this alert appears: "You need to be logged in to view that page".

I tried to rebuild cache etc.

PS. I don't have an issue to access this page as an admin. Maybe I should use different access arguments?

1 Answer 1

1

First off, checking access as user 1 or Administrator is not a test because no permission checks are done for user 1, and in most cases Administrators have all permissions.

Two, your permission is mixed case, change it to all lower case and clear the cache.

Three, in order to access anything under /admin, user will also need access administration pages permission as well - or whatever permission is assigned on that menu item (I think that’s the one).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.