Rules - New events inside code not shown in interface I am trying to insert a new event inside an already existing module. The module is Nodeaccess https://www.drupal.org/project/nodeaccess it's used to grant users edit/delete permissions to single nodes.

inside sites/all/modules/nodeaccess i have made the file nodeaccess.rules.inc which contains this code:



/**
 * @file
 * Rules integration.
 */

/**
 * Implementation of hook_rules_event_info().
 */
function nodeaccess_rules_event_info() {
    return array(
        'nodeaccess_grant_permissions' =&gt; array(
            'label' =&gt; t('Permissions are granted to a user'),
            'group'=&gt;t("NodeAccess"),
            'variables' =&gt; array(
                'granter' =&gt; array('type' =&gt; 'user', 'label' =&gt; t('The user who granted the permissions.')),
                'granted' =&gt; array('type' =&gt; 'user', 'label' =&gt; t('The user who got the new permissions.')),
                'node' =&gt; array('type' =&gt; 'node', 'label' =&gt; t('The node on which the permission has been granted.')),
            ),
        ),
    );
}


Looking at different guides on the web it looks like this is all you have to do to get a new event but in the events list i can't find it. 
I have tried:


refreshing the cache 
disabling/enabling nodeaccess module then refreshing the cache (and rebuilding permissions as it was requested)
disabling/enabling rules module then refreshing the cache
adding the rule entry in a *.rules.inc file i've seen it's being imported (namely the feeds.rules.inc file from the feeds module which already existed when i installed the rules module)


Nothing worked so far

EDIT: i have changed the function name and the entry name (both from "node_access" to "nodeaccess" ) but it's still not showing. I have discovered that if i add an entry on a file i know it's being imported and keep the prefix of the entry, then it shows up
The problem is the function name. Since the module name is nodeaccess (and not node_access), function name should be nodeaccess_rules_event_info

However, it is not recommended to add anything to a contributed module (unless you are going to contribute back to the module's issue queue).

If this rule is specific your project, you can add it in your own custom module.