[development] modify permissions using hook_menu_alter()

Pedro Faria predofaria at gmail.com
Tue Apr 28 14:56:17 UTC 2009


Check at apache errors log.

On Tue, 2009-04-28 at 16:21 +0200, Lluís wrote:
> I am developing a module which will allow users to post certain
> content-types after 30 days of being registered.
> I think this is achieved using hook_menu_alter(); but my code freezes
> drupal with a white screen.
> 
> Whats is missing in my code?
> 
> function wu_menu_alter(&$menu) {
>   foreach (node_get_types('types', NULL, TRUE) as $type) {
>     $type_url_str = str_replace('_', '-', $type->type);
>     $menu['node/add/'.$type_url_str]['access callback'] = 'wu_role_access';
>     $menu['node/add/'.$type_url_str]['access arguments'] =
> array('create', $type->type);
>   }
> }
> 
> function wu_role_access($a='',$b='',$c='',$d='',$e='') {
> //  echo "**************"; //if uncommented this is displayed
>   return true; //when it works I will implement the rest of the function
> }
> 
> 



More information about the development mailing list