Hi everyone,
To begin: I have OCD so I need 'perfect' code and a 'perfect' database in my sites. I go crazy otherwise.
I named a hook_perm permission on one of my sites very badly and want to rename it. I know that whatever happens I can just go in and redo the permissions with their no name, but I'm wondering if that will leave extra stuff in the database. I like keeping my databases very clean.
On a site note, I'm also wondering how often hook_perm is called. I have a module that requires a new permission every time a new node of a certain type is called, so the hook queries for all those nodes and builds the permissions from the names. I'm hoping hook_permissions is called once a cache clear or cron run or even when visiting the permissions page because I'm somewhat obsessed with performance these days.
--Tiuya
Comments
Just to follow up -- it looks
Just to follow up -- it looks like hook_perm isn't called all that often. It looks like it's only called when modules are enabled or caches are cleared. I did a drupal_set_message('hook_perm called') within a hook_perm to find out.