Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Splitting off from #306027: user_modules_uninistalled() is missing.
So we have hook_perm()
This could be hook_permission() hook_permissions() or hook_permissions_info()
Comment | File | Size | Author |
---|---|---|---|
#3 | 506976.patch | 20.91 KB | asimmonds |
Comments
Comment #1
catchComment #2
agentrickardhook_permission() seems more in line with core -- e.g. hook_user, hook_block...
Comment #3
asimmonds CreditAttribution: asimmonds commentedInitial attempt at renaming hook_perm to hook_permission, hope I got them all...
Comment #4
Dries CreditAttribution: Dries commentedYes, p-uh-lease! :)
Comment #5
agentrickardThere is a stray user_admin_perm() menu callback that is unrelated. Otherwise, the patch caught all instances.
See #510740: Rename user_admin_perm() for that. Otherwise RTBC.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks catch.
We need to update the upgrade instructions in the handbook so I'm marking this 'code needs work'.
Comment #7
agentrickardDone.
Comment #8
agentrickardComment #9
XanoShouldn't this be hook_permission_info(), since we provide information about permissions and do not process anything in there?
Comment #10
agentrickard@Xano
I hope not. By that standard, we would have hook_menu_info() and hook_theme_info() as well., plus others, I am sure.
Do we have any agreed upon standards for function naming that we can reference here?
Comment #11
catchCrell's arguing for a lot of these 'called once, cached, never called again' hooks to all be renamed to hook_$hook_info() - not sure if there's a renaming issue anywhere though - but it's not really connected to this specific one anyway.
Comment #12
agentrickardOK, so we can clean this up as part of that initiative and don't need to discuss here?
Comment #13
catchI think so yeah.