You are here

function subscriptions_permission in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 7 subscriptions.module \subscriptions_permission()

Implements hook_permission().

Return value

array

File

./subscriptions.module.old.php, line 275
Subscriptions module.

Code

function subscriptions_permission() {

  // Enforce a reasonable ordering of the permissions.
  $placeholders = array(
    'subscribe to content' => array(),
    'subscribe to content types' => array(),
    'subscribe to all content types' => array(),
  );
  $return = array_merge(array(
    'administer user subscriptions' => array(
      'title' => t('Administer user subscriptions'),
      'description' => t('Administer the subscriptions of all other users.'),
      'restrict access' => TRUE,
    ),
    'bulk-administer user subscriptions' => array(
      'title' => t('Administer user subscriptions using bulk user operations'),
      'description' => t('Add subscriptions to or remove subscriptions from multiple users at once from the user list.'),
      'restrict access' => TRUE,
    ),
  ), $placeholders, subscriptions_types('permission'), array(
    'suspend own subscriptions' => array(
      'title' => t('Suspend own subscriptions'),
      'description' => t('Temporarily suspend subscriptions — resuming is always allowed.'),
    ),
  ));
  foreach (array_keys($placeholders) as $key) {
    if (empty($return[$key])) {
      unset($return[$key]);
    }
  }
  return $return;
}