mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-14 04:16:54 +01:00
* [MOD] Config module. Work in progress
* [MOD] Improved event handling. Work in progress
This commit is contained in:
@@ -26,6 +26,8 @@ namespace SP\Modules\Web\Controllers;
|
||||
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use SP\Core\Acl\ActionsInterface;
|
||||
use SP\Core\Acl\UnauthorizedPageException;
|
||||
use SP\Core\Events\Event;
|
||||
use SP\Core\Events\EventMessage;
|
||||
use SP\Http\JsonResponse;
|
||||
@@ -86,4 +88,15 @@ class ConfigImportController extends SimpleControllerBase
|
||||
$this->returnJsonResponseException($e);
|
||||
}
|
||||
}
|
||||
|
||||
protected function initialize()
|
||||
{
|
||||
try {
|
||||
$this->checkAccess(ActionsInterface::IMPORT_CONFIG);
|
||||
} catch (UnauthorizedPageException $e) {
|
||||
$this->eventDispatcher->notifyEvent('exception', new Event($e));
|
||||
|
||||
$this->returnJsonResponseException($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user