Add permissions for a new content type Context: I created a new content type (press room nodetype) locally and made a feature with it so it is easier to deploy on my dev-stage-prod environments. This works perfectly well. The thing is, is I need to add permissions to some user roles right away in the same deployment process. I can't find the proper way to run some code after the feature-revert-all; 

At the moment I put my code in a new module press_room.install. 

function press_room_update_7001() {
    module_enable(['press_room_nodetype']); // installs the feature that will add the new content type

    $permission = [
        'edit any press_room content' =&gt; true,
    ];
    _add_permission_to_role('myrole',$permission); // too soon, content type not yet created
}


This module is enabled by another .install (homepage).

function homepage_update_7003() {
    module_enable(['press_room']);
}


With this code the new content type is created and the module to preprocess its output is enabled but the permissions are not given. It seems the content type is not (fully) created when the permissions needs to be added, so Drupal skips those lines and do nothing. If I run my code a second time, it works since the content type already exists.

Has anyone a solution to process code after a new content type has been created. What is the proper way to do this? Thank you.
This may not be what you're looking for but here is what we do to deploy on several production sites.


Store as much in Features as possible
Write update scripts when needed (as you've done). However, we enable modules via drush, never in code.
then run: drush en feature_module_name -y &amp;&amp; drush updb

If multiple modules need to be enabled, we normal setup a chain of dependencies in the *.info files.