I have a custom module that has type MENU_LOCAL_TASK with path user/%/custom-page.
The page callback is displaying a content and with custom page arguments and access arguments functions, only the author of the content can see that content. So far so good.
I have authenticated users and custom role (editor).
Now my goal is to display the MENU_LOCAL_TASK with the page callback content only for the authenticated users, not the editor.
All authenticated users are with role[3] and the Editor is with role[5]. Because of the role "Editor" is automatically authenticated user I cannot set the custom page to be visible only for the other authenticated users.
On my page.tpl.php I've managed to display links that will be visible only for authenticated user without user with role[5] (editor) with this code and its working great.
<?php
if(isset($user->roles[3])){
//visible only for roles[3], the ordinary authenticated users
}
How can I do this with my custom module?
I didn't find an examples in hook_menu for roles.
Hook_permission() didn't helped, because when I choose the authenticated user in drupal permissions UI, automatically marks the editor role.
I'm using Drupal 7.