Refactors AccessControl and passes it as dependency to JSON API and Menu

This commit is contained in:
Vlad
2017-08-14 11:28:31 -04:00
parent 51fbf29031
commit 2e5554a3af
12 changed files with 286 additions and 241 deletions

View File

@ -12,8 +12,9 @@ class MP2Migrator extends APIEndpoint {
'global' => AccessControl::PERMISSION_MANAGE_SETTINGS
);
public function __construct() {
$this->MP2Migrator = new \MailPoet\Config\MP2Migrator();
public function __construct(AccessControl $access_control) {
$this->access_control = $access_control;
$this->MP2Migrator = new \MailPoet\Config\MP2Migrator($this->access_control);
}
/**