30 lines
691 B
PHP
30 lines
691 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\FileManager\Block\Adminhtml;
|
|
|
|
use Magento\Backend\Block\Template;
|
|
use Magento\Backend\Block\Template\Context;
|
|
use Magento\Framework\AuthorizationInterface;
|
|
|
|
class Upload extends Template
|
|
{
|
|
public function __construct(
|
|
Context $context,
|
|
private readonly AuthorizationInterface $authorization,
|
|
array $data = []
|
|
) {
|
|
parent::__construct($context, $data);
|
|
}
|
|
|
|
public function canUpload(): bool
|
|
{
|
|
return $this->authorization->isAllowed('Esun_FileManager::upload');
|
|
}
|
|
|
|
public function getUploadUrl(): string
|
|
{
|
|
return $this->getUrl('esun_filemanager/file/upload');
|
|
}
|
|
}
|