You are here

function fieldable_panels_panes_permission in Fieldable Panels Panes (FPP) 7

Implements hook_permission().

File

./fieldable_panels_panes.module, line 443
Maintains an entity that appears as panel pane content.

Code

function fieldable_panels_panes_permission() {
  $perms = array(
    'administer fieldable panels panes' => array(
      'title' => t('Administer fieldable panels panes'),
      'description' => t('Allows users complete control over fieldable panel pane entities. This permission overrides any other permission.'),
    ),
    'access fieldable panels panes master list' => array(
      'title' => t('Access list pages for fieldable panels panes'),
      'description' => t('Allows users to see fieldable panel panes bundles and entities.'),
    ),
  );
  $entity_info = entity_get_info('fieldable_panels_pane');
  foreach ($entity_info['bundles'] as $bundle => $info) {
    $perms["create fieldable {$bundle}"] = array(
      'title' => t('Create new %type', array(
        '%type' => $info['label'],
      )),
      'description' => t('Allows users to create new fieldable panel pane entities of bundle %type.', array(
        '%type' => $info['label'],
      )),
    );
    $perms["edit fieldable {$bundle}"] = array(
      'title' => t('Edit %type', array(
        '%type' => $info['label'],
      )),
      'description' => t('Allows users to edit fieldable panel pane entities of bundle %type. This is a minimum permission; it is required to be able to edit a fieldable pane at all, but higher access requirements on an individual pane can override it.', array(
        '%type' => $info['label'],
      )),
    );
    $perms["delete fieldable {$bundle}"] = array(
      'title' => t('Delete %type', array(
        '%type' => $info['label'],
      )),
      'description' => t('Allows users to delete fieldable panel pane entities of bundle %type. Users must also be able to edit the pane to delete it.', array(
        '%type' => $info['label'],
      )),
    );
  }
  return $perms;
}