Hello, I am trying add a category in the user edit page and to restrict access to it:

if($op == 'categories'){
$data[] = array(
'name' => 'name',
'title' => 'The Title',
'access arguments' => array('perms required')
);
return $data;
}

It is supposed to appear only for the roles with 'perms required', but it does not appear to anyone.
If I remove the access arguments it works perfect.

I'm I on the right track?

Regards.

(edit the title said hook menu, I changed it)

Comments

jaypan’s picture

You don't have a page callback.

Contact me to contract me for D7 -> D10/11 migrations.

feloescoto’s picture

sorry, what do you mean by that?

the list has access callback and access arguments, should I include a page callback?

jaypan’s picture

If you don't have a page callback, there is nothing for the path to show. The page callback generates the the page that the user will see.

Contact me to contract me for D7 -> D10/11 migrations.

feloescoto’s picture

thanks, but the hook_user does not give me a page callback option?
How would I include that?

jaypan’s picture

You realize the thread title is asking about hook_menu right?

Contact me to contract me for D7 -> D10/11 migrations.

feloescoto’s picture

I changed that already, thanks for pointing it out :)