function rules_element_invoke_component_access_callback

Access callback for the invoke component condition/action.

Related topics

2 string references to 'rules_element_invoke_component_access_callback'
rules_rules_core_action_info in modules/rules_core.rules.inc
Implements hook_rules_action_info() on behalf of the pseudo rules_core module.
rules_rules_core_condition_info in modules/rules_core.rules.inc
Implements hook_rules_condition_info() on behalf of the pseudo rules_core module.

File

modules/rules_core.rules.inc, line 323

Code

function rules_element_invoke_component_access_callback($type, $name) {
    // Cut of the leading 'component_' from the action name.
    $component = rules_config_load(substr($name, 10));
    if (!$component) {
        // Missing component.
        return FALSE;
    }
    // If access is not exposed for this component, default to component access.
    if (empty($component->access_exposed)) {
        return $component->access();
    }
    // Apply the permissions.
    return user_access('bypass rules access') || user_access("use Rules component {$component->name}");
}