test(IT): Test Config Account use cases

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-08-29 18:59:58 +02:00
parent e2d67fef14
commit 7b24cded97
4 changed files with 114 additions and 60 deletions

View File

@@ -54,6 +54,11 @@ final class XmlExportController extends SimpleControllerBase
{
use JsonTrait;
/**
* @throws SessionTimeout
* @throws SPException
* @throws UnauthorizedPageException
*/
public function __construct(
Application $application,
SimpleControllerHelper $simpleControllerHelper,
@@ -62,6 +67,9 @@ final class XmlExportController extends SimpleControllerBase
private readonly PathsContext $pathsContext
) {
parent::__construct($application, $simpleControllerHelper);
$this->checks();
$this->checkAccess(AclActionsInterface::CONFIG_BACKUP);
}
/**
@@ -132,22 +140,4 @@ final class XmlExportController extends SimpleControllerBase
return $this->returnJsonResponseException($e);
}
}
/**
* initialize
*
* @throws SPException
* @throws SessionTimeout
*/
protected function initialize(): void
{
try {
$this->checks();
$this->checkAccess(AclActionsInterface::CONFIG_BACKUP);
} catch (UnauthorizedPageException $e) {
$this->eventDispatcher->notify('exception', new Event($e));
$this->returnJsonResponseException($e);
}
}
}