You are here

function rules_link_permission in Rules Link 7

Same name and namespace in other branches
  1. 7.2 rules_link.module \rules_link_permission()

Implements hook_permission().

File

./rules_link.module, line 59
Rules Link - module file.

Code

function rules_link_permission() {
  $permissions = array(
    'administer rules links' => array(
      'title' => t('Administer rules links'),
      'description' => t('Create and delete rules links and set their permissions.'),
    ),
  );
  foreach (rules_link_get_links() as $link) {
    $name = check_plain($link->name);
    $permissions += array(
      "access rules link {$name}" => array(
        'title' => t('%link_label: Execute rules link', array(
          '%link_label' => $link->label,
        )),
      ),
    );
  }
  return $permissions;
}