getSettings('site'); if ($siteInfo['status'] == 'closed') { throw new ServiceUnavailableException('sys.service_unavailable'); } } public function checkAuthUser($userId) { if (empty($userId)) { throw new UnauthorizedException('sys.unauthorized'); } } public function checkOwner($userId, $ownerId) { if ($userId != $ownerId) { throw new ForbiddenException('sys.forbidden'); } } }