init
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user