public function onRun()
{
$redirectUrl = $this->controller->pageUrl($this->property('redirect'));
$allowedGroup = $this->property('security', self::ALLOW_ALL);
$isAuthenticated = Auth::check();
if (!$isAuthenticated && $allowedGroup == self::ALLOW_USER) {
return Redirect::guest($redirectUrl);
} elseif ($isAuthenticated && $allowedGroup == self::ALLOW_GUEST) {
return Redirect::guest($redirectUrl);
}
$this->page['user'] = $this->user();
}