[development] hook_user('categories')

David Cohen drupal at dave-cohen.com
Tue Apr 28 23:52:01 UTC 2009


Sometime in the 5.x-6.x timeframe, the API for hook_user($op ==
'categories') changed in a major way.  No longer is the $account
parameter passed in, and I think the data structure to be returned
gained a lot of options.  But I can't find the documentation for this. 
Its not in the 5.x to 6.x page on d.o (http://drupal.org/node/114774),
nor is it reflected on http://api.drupal.org/api/function/hook_user/6.

Can someone point me to general doc, or an example of how to emulate the
following logic in D6.  The logic is basically to show the user an edit
category only if they have permission to change their own settings.

  if ($op == 'categories') {
    if (user_access('edit own extended permissions') &&
        $user->uid == $account->uid) {
      // build the data structure
    }
  }

The above logic wont apply in D6 because $account is not passed in, and
the return value is expected to have new menu data structure elements
which take the place of that logic.  But I'm struggle to figure out, in
part because I can't find the doc.

thanks.



More information about the development mailing list