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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 882814_0.patch | 3.92 KB | gdd |
| #3 | 882814.patch | 3.89 KB | gdd |
| #1 | 882814.patch | 32.08 KB | gdd |
Comments
Comment #1
gddHere's the patch
Comment #2
moshe weitzman commentedThe doxygen for @return needs customizing. Also, an unrelated (and important) patch is mixed in.
Comment #3
gddA copy/paste error and an unrelated patch. It's like a 'Best of patch gaffes'.
Comment #4
moshe weitzman commented"+ // 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.
Comment #5
gddI totally lost track of this patch but I would still love it to get in. Rerolled.
Comment #6
moshe weitzman commentedsorry to be a pest, but that sounds like module_implements('permission'). This is different.
Powered by Dreditor.