As stated above, there should be an API function to retrieve all hook_perm() implementations on a system. In D6 if you wanted to know what a specific permission string was you could go to the permissions page and find it, but now that page gives human readable titles instead. There are lots of scenarios where this information could be useful.

The attached patch creates this API function, and modifies user_admin_permissions() to use it. It's a first pass, comments welcome.

CommentFileSizeAuthor
#5 882814_0.patch3.92 KBgdd
#3 882814.patch3.89 KBgdd
#1 882814.patch32.08 KBgdd

Comments

gdd’s picture

Status: Active » Needs review
StatusFileSize
new32.08 KB

Here's the patch

moshe weitzman’s picture

Status: Needs review » Needs work

The doxygen for @return needs customizing. Also, an unrelated (and important) patch is mixed in.

gdd’s picture

Status: Needs work » Needs review
StatusFileSize
new3.89 KB

A copy/paste error and an unrelated patch. It's like a 'Best of patch gaffes'.

moshe weitzman’s picture

"+ // Get a list of all the modules implementing a hook_permission() and sort by
+ // display name."

Looks like it sorts by module name to me. I know that you didn't change this code, but you gotta fix it if you move it! Core patch annoyance #434.

gdd’s picture

StatusFileSize
new3.92 KB

I totally lost track of this patch but I would still love it to get in. Rerolled.

moshe weitzman’s picture

Status: Needs review » Needs work
+++ modules/user/user.module	24 Sep 2010 18:19:18 -0000
@@ -3665,3 +3665,22 @@ function user_file_download_access($fiel
+ * Get a list of the modules that implement hook_permission().

sorry to be a pest, but that sounds like module_implements('permission'). This is different.

Powered by Dreditor.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.