You are here

function workflow_access_features_export in Workflow 7

Same name and namespace in other branches
  1. 7.2 workflow_access/workflow_access.features.inc \workflow_access_features_export()

Implements hook_features_export().

Inform Features about dependencies.

File

workflow_access/workflow_access.features.inc, line 53

Code

function workflow_access_features_export($data, &$export, $module_name = '') {
  $roles = _workflow_access_get_affected_roles();
  $export['dependencies']['workflow_access'] = 'workflow_access';
  $export['dependencies']['workflow'] = 'workflow';
  $pipe = array();
  foreach ($data as $component) {
    $export['features']['workflow_access'][$component] = $component;

    // Access configuration for a workflow needs that workflow to exist.
    $pipe['workflow'][$component] = $component;

    // And it needs the roles to which rights are granted.
    foreach ($roles[$component] as $rname) {
      $pipe['user_role'][$rname] = $rname;
    }
  }
  return $pipe;
}