You are here

function rules_action_entity_savedelete_access in Rules 7.2

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
General entity related rules integration.

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;
}