No Soup for You!

6 January, 2021

I was working on a new Drupal 6 module, and at least until things became more complex, I was writing it in a top-down manner: the .info file, the .install file, and was working on defining permissions via hook_perm(). It should have been very easy. I created the following:

unction mymodule_perm() { return array('permission for my module'); } 

Then I cleared cache, just in case, and voilà...nothing.

The permission did not appear in user/permissions. To keep the story short, I'll skip the hair-pulling and jump right to the point, where it occurred to me that I'd put the function in mymodule.admin.inc instead of mymodule.module, where it needs to be in order to be processed!

Login or Register to Comment!