function rules_permission

Implements hook_permission().

File

./rules.module, line 1299

Code

function rules_permission() {
    $perms = array(
        'administer rules' => array(
            'title' => t('Administer rule configurations'),
            'description' => t('Administer rule configurations including events, conditions and actions for which the user has sufficient access permissions.'),
        ),
        'bypass rules access' => array(
            'title' => t('Bypass Rules access control'),
            'description' => t('Control all configurations regardless of permission restrictions of events, conditions or actions.'),
            'restrict access' => TRUE,
        ),
        'access rules debug' => array(
            'title' => t('Access the Rules debug log'),
        ),
    );
    // Fetch all components to generate the access keys.
    $conditions['plugin'] = array_keys(rules_filter_array(rules_fetch_data('plugin_info'), 'component', TRUE));
    $conditions['access_exposed'] = 1;
    $components = entity_load('rules_config', FALSE, $conditions);
    $perms += rules_permissions_by_component($components);
    return $perms;
}