protected function getAuth() { $auth = AuthorizedUser::getInstance(); if (is_null($auth)) { throw new Exception("Unauthorized", 2); } return $auth; }