protected function getBulkOptions()

in modules/quanthub_core/src/Plugin/views/field/QuanthubViewsBulkOperationsBulkForm.php [23:49]


  protected function getBulkOptions(): array {
    parent::getBulkOptions();

    if (!$this->currentUser->hasPermission(
      QuanthubWorkflowInterface::PUBLISH_PERMISSION
    )) {
      unset($this->bulkOptions[6]);
    }
    if (!$this->currentUser->hasPermission(
      QuanthubWorkflowInterface::UNPUBLISH_PERMISSION
    )) {
      unset($this->bulkOptions[7]);
    }
    if (!$this->currentUser->hasPermission(
      QuanthubWorkflowInterface::DRAFT_PERMISSION
    )) {
      unset($this->bulkOptions[8]);
    }

    if (
      !$this->currentUser->hasPermission('delete content translations') &&
      !$this->currentUser->hasPermission('delete any dataset content')
    ) {
      unset($this->bulkOptions[9]);
    }
    return $this->bulkOptions;
  }