You are here

function field_permissions_list in Field Permissions 7

Same name and namespace in other branches
  1. 6 includes/admin.inc \field_permissions_list()

Obtain the list of field permissions.

Parameters

string $field_label: The human readable name of the field to use when constructing permission names. Usually this will be derived from one or more of the field instance labels.

2 calls to field_permissions_list()
field_permissions_list_field_permissions in ./field_permissions.admin.inc
Returns field permissions in a format suitable for use in hook_permission().
field_permissions_overview in ./field_permissions.admin.inc
Menu callback; Field permissions overview.

File

./field_permissions.admin.inc, line 16
Administrative interface for the Field Permissions module.

Code

function field_permissions_list($field_label = '') {
  $permissions = array(
    'create' => array(
      'label' => t('Create field'),
      'title' => t('Create own value for field %field', array(
        '%field' => $field_label,
      )),
    ),
    'edit own' => array(
      'label' => t('Edit own field'),
      'title' => t('Edit own value for field %field', array(
        '%field' => $field_label,
      )),
    ),
    'edit' => array(
      'label' => t('Edit field'),
      'title' => t("Edit anyone's value for field %field", array(
        '%field' => $field_label,
      )),
    ),
    'view own' => array(
      'label' => t('View own field'),
      'title' => t('View own value for field %field', array(
        '%field' => $field_label,
      )),
    ),
    'view' => array(
      'label' => t('View field'),
      'title' => t("View anyone's value for field %field", array(
        '%field' => $field_label,
      )),
    ),
  );
  drupal_alter('field_permissions_list', $permissions, $field_label);
  return $permissions;
}