I have several custom modules which implement hook_action_info() for my own actions.

When I use

permissions_grant_permissions('some role', array('mymodule_do_something_action'));

then permissions_grant_permissions() cross-references the requested new permissions by calling

$defined_permissions = module_invoke_all('perm');

which is a good thing to do. However it will not pick up the above permissions, because hook_perm() does not return those.

My current workaround is that I call mymodule_action_info() in mymodule_perm() to return the appropriate permissions for cross-referencing, however that would mean I have to do it all over again in mymodule2 and mymoduleabc ... Or have an additional module with its own hook_perm() running module_invoke_all('action_info').

I suggest permissions_grant_permissions() (and other functions performing the cross-reference) should also get additional permissions from hook_action_info()

Comments

elmiguel’s picture

Status: Active » Closed (works as designed)

D'oh, no it works correctly. sorry for the hassle

elmiguel’s picture

Issue summary: View changes

Edited because I overlooked that hook_user_operations() is actually called from within VBO.