You are here

function user_permission_features_export_options in Features 7.2

Same name and namespace in other branches
  1. 6 includes/features.user.inc \user_permission_features_export_options()
  2. 7 includes/features.user.inc \user_permission_features_export_options()

Implements hook_features_export_options().

File

includes/features.user.inc, line 59
Features integration for 'user' module.

Code

function user_permission_features_export_options() {
  $modules = array();
  $module_info = system_get_info('module');
  foreach (module_implements('permission') as $module) {
    $modules[$module] = $module_info[$module]['name'];
  }
  ksort($modules);
  $options = array();
  foreach ($modules as $module => $display_name) {
    if ($permissions = module_invoke($module, 'permission')) {
      foreach ($permissions as $perm => $perm_item) {

        // Export vocabulary permissions using the machine name, instead of
        // vocabulary id.
        _user_features_change_term_permission($perm);
        $options[$perm] = strip_tags("{$display_name}: {$perm_item['title']}");
      }
    }
  }
  return $options;
}