You are here

public function ViewsBulkOperationsAction::getAccessMask in Views Bulk Operations (VBO) 7.3

Returns the access bitmask for the operation, used for entity access checks.

Overrides ViewsBulkOperationsBaseOperation::getAccessMask

File

plugins/operation_types/action.class.php, line 21
Defines the class for core actions. Belongs to the "action" operation type plugin.

Class

ViewsBulkOperationsAction
@file Defines the class for core actions. Belongs to the "action" operation type plugin.

Code

public function getAccessMask() {

  // Assume edit by default.
  if (empty($this->operationInfo['behavior'])) {
    $this->operationInfo['behavior'] = array(
      'changes_property',
    );
  }
  $mask = 0;
  if (in_array('views_property', $this->operationInfo['behavior'])) {
    $mask |= VBO_ACCESS_OP_VIEW;
  }
  if (in_array('changes_property', $this->operationInfo['behavior'])) {
    $mask |= VBO_ACCESS_OP_UPDATE;
  }
  if (in_array('creates_property', $this->operationInfo['behavior'])) {
    $mask |= VBO_ACCESS_OP_CREATE;
  }
  if (in_array('deletes_property', $this->operationInfo['behavior'])) {
    $mask |= VBO_ACCESS_OP_DELETE;
  }
  return $mask;
}