Commit 000d4b1a authored by Mark Harding's avatar Mark Harding

(fix): canary flags not working on server side

No related merge requests found
Pipeline #102267845 waiting for delayed job with stages
in 7 minutes and 57 seconds
......@@ -23,10 +23,11 @@ class Manager
/** @var Cookie $cookie */
private $cookie;
public function __construct($config = null, $cookie = null)
public function __construct($config = null, $cookie = null, $user = null)
{
$this->config = $config ?: Di::_()->get('Config');
$this->cookie = $cookie ?: new Cookie;
$this->user = $user ?? Session::getLoggedInUser();
}
/**
......@@ -59,6 +60,10 @@ class Manager
return true;
}
if ($features[$feature] === 'canary' && $this->user && $this->user->get('canary')) {
return true;
}
return $features[$feature] === true;
}
......
Please register or to comment