You are here

public function ArchiveDownloader::canDownload in Content Synchronizer 8.2

Same name and namespace in other branches
  1. 8 src/Service/ArchiveDownloader.php \Drupal\content_synchronizer\Service\ArchiveDownloader::canDownload()
  2. 3.x src/Service/ArchiveDownloader.php \Drupal\content_synchronizer\Service\ArchiveDownloader::canDownload()

Return true if the current page is admin.

Return value

bool True if can download.

See also

https://drupal.stackexchange.com/questions/219370/how-to-test-if-current...

1 call to ArchiveDownloader::canDownload()
ArchiveDownloader::donwloadArchive in src/Service/ArchiveDownloader.php
Donwload archive by adding js library.

File

src/Service/ArchiveDownloader.php, line 40

Class

ArchiveDownloader
Class ArchiveDownloader.

Namespace

Drupal\content_synchronizer\Service

Code

public function canDownload() {
  $account = \Drupal::currentUser();
  return User::load($account
    ->id())
    ->hasPermission('add export entity entities');
}