function rules_action_entity_savedelete_access

Custom access callback for data save and delete action.

Related topics

1 string reference to 'rules_action_entity_savedelete_access'
rules_entity_action_info in modules/entity.rules.inc
Implements hook_rules_action_info() on behalf of the entity module.

File

modules/entity.rules.inc, line 221

Code

function rules_action_entity_savedelete_access(RulesAbstractPlugin $element) {
    if ($wrapper = $element->applyDataSelector($element->settings['data:select'])) {
        $op = $element->getElementName() == 'entity_save' ? 'save' : 'delete';
        return $wrapper instanceof EntityDrupalWrapper && $wrapper->entityAccess($op);
    }
    return FALSE;
}