You are here

function features_perm in Features 6

Implementation of hook_perm().

File

./features.module, line 230
Module file for the features module, which enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together statisfy a certain use-case.

Code

function features_perm() {
  $perms = array(
    'administer features',
    'manage features',
  );

  // Generate permissions for any default node types provided by features.
  foreach (node_get_types() as $type) {
    if ($type->module == 'features') {
      $name = check_plain($type->type);
      $perms[] = 'create ' . $name . ' content';
      $perms[] = 'delete own ' . $name . ' content';
      $perms[] = 'delete any ' . $name . ' content';
      $perms[] = 'edit own ' . $name . ' content';
      $perms[] = 'edit any ' . $name . ' content';
    }
  }
  return $perms;
}