Stop abbreviating permissions to perm

catch - July 1, 2009 - 09:01
Project:Drupal
Version:7.x-dev
Component:user.module
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:Favorite-of-Dries
Description

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()

#1

catch - July 1, 2009 - 09:06
Title:Rename stop abbreviating permissions» Stop abbreviating permissions to perm

#2

agentrickard - July 1, 2009 - 14:44

hook_permission() seems more in line with core -- e.g. hook_user, hook_block...

#3

asimmonds - July 5, 2009 - 01:52
Status:active» needs review

Initial attempt at renaming hook_perm to hook_permission, hope I got them all...

AttachmentSizeStatusTest resultOperations
506976.patch20.91 KBIdlePassed: 11563 passes, 0 fails, 0 exceptionsView details | Re-test

#4

Dries - July 5, 2009 - 05:24

Yes, p-uh-lease! :)

#5

agentrickard - July 5, 2009 - 15:58
Status:needs review» reviewed & tested by the community

There 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.

#6

Dries - July 5, 2009 - 17:58
Status:reviewed & tested by the community» needs work

Committed to CVS HEAD. Thanks catch.

We need to update the upgrade instructions in the handbook so I'm marking this 'code needs work'.

#7

agentrickard - July 5, 2009 - 18:46
Status:needs work» reviewed & tested by the community

Done.

#8

agentrickard - July 5, 2009 - 18:59
Status:reviewed & tested by the community» fixed

#9

Xano - July 5, 2009 - 19:07

Shouldn't this be hook_permission_info(), since we provide information about permissions and do not process anything in there?

#10

agentrickard - July 6, 2009 - 14:24

@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?

#11

catch - July 6, 2009 - 14:33

Crell'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.

#12

agentrickard - July 6, 2009 - 14:34

OK, so we can clean this up as part of that initiative and don't need to discuss here?

#13

catch - July 6, 2009 - 14:35

I think so yeah.

#14

System Message - July 20, 2009 - 14:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.