I want to know there is a better way to do it
I want to restrict a page to only logged in users.
Finally I am using below code, which works to me
class ProfilePage_Controller extends Page_Controller {
public function init()
{
parent::init();
$member = Member::currentUser();
if(!$member) Security::permissionFailure();
}
}