You are here

public function CommentDeleteManager::getOperations in Comment Delete 8

Get the comment delete operations available to current user.

Return value

array An array of available comment delete operations.

File

src/CommentDeleteManager.php, line 133

Class

CommentDeleteManager
Service container for comment delete operations.

Namespace

Drupal\comment_delete

Code

public function getOperations() {
  $options = [];
  if ($this->currentUser
    ->hasPermission('delete comment replies')) {
    $options[self::DELETE_REPLIES] = $this
      ->t('Delete the comment and its replies');
  }
  if (!$this->config
    ->get('soft') && $this->currentUser
    ->hasPermission('move comment replies')) {
    $options[self::MOVE_REPLIES] = $this
      ->t('Delete the comment and move its replies up');
  }
  $options[self::KEEP_REPLIES] = $this
    ->t('Delete the comment and keep its replies');
  return $options;
}