You are here

function pm_permission_hunt_and_update_all_child_permission in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 includes/pm.permission.inc \pm_permission_hunt_and_update_all_child_permission()

Check and performs access update if supplied pmorganization.

1 call to pm_permission_hunt_and_update_all_child_permission()
pm_node_update in ./pm.module
Implements hook_node_update().

File

includes/pm.permission.inc, line 693
Main module file for the pm_permission module.

Code

function pm_permission_hunt_and_update_all_child_permission($node) {
  $nids = pm_permission_get_all_child_nids($node->nid);
  if ($nids) {
    $batch = array(
      'title' => t('Rebuilding access permissions for the @type "@title"', array(
        '@type' => $node->type,
        '@title' => $node->title,
      )),
      'operations' => array(
        array(
          '_pm_permission_node_access_rebuild_batch_operation',
          array(
            $nids,
          ),
        ),
      ),
      'finished' => '_pm_permission_node_access_rebuild_batch_finished',
    );
    batch_set($batch);
  }
}