function rules_permissions_by_component

Helper function return permissions for components that have access exposed.

3 calls to rules_permissions_by_component()
RulesPluginUI::settingsFormPermissionMatrix in ui/ui.core.inc
Provides a matrix permission for the component based in the existing roles.
RulesPluginUI::settingsFormSubmit in ui/ui.core.inc
rules_permission in ./rules.module
Implements hook_permission().

File

./rules.module, line 1327

Code

function rules_permissions_by_component(array $components = array()) {
    $perms = array();
    foreach ($components as $component) {
        $perms += array(
            "use Rules component {$component->name}" => array(
                'title' => t('Use Rules component %component', array(
                    '%component' => $component->label(),
                )),
                'description' => t('Controls access for using the component %component via the provided action or condition. <a href="@component-edit-url">Edit this component.</a>', array(
                    '%component' => $component->label(),
                    '@component-edit-url' => url(RulesPluginUI::path($component->name)),
                )),
            ),
        );
    }
    return $perms;
}