Adds access management to router and updates endpoints accordingly
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Router\Endpoints;
|
||||
|
||||
use MailPoet\Config\AccessControl;
|
||||
use MailPoet\Config\Env;
|
||||
use MailPoet\Models\Newsletter;
|
||||
use MailPoet\Models\SendingQueue;
|
||||
use MailPoet\Models\Subscriber;
|
||||
@@ -18,10 +18,13 @@ class ViewInBrowser {
|
||||
const ACTION_VIEW = 'view';
|
||||
public $allowed_actions = array(self::ACTION_VIEW);
|
||||
public $data;
|
||||
public $permissions = array(
|
||||
'global' => AccessControl::NO_ACCESS_RESTRICTION
|
||||
);
|
||||
|
||||
function __construct($data) {
|
||||
function __construct($data, AccessControl $access_control) {
|
||||
$this->access_control = $access_control;
|
||||
$this->data = $this->_processBrowserPreviewData($data);
|
||||
$this->access_control = new AccessControl();
|
||||
}
|
||||
|
||||
function view() {
|
||||
|
Reference in New Issue
Block a user