@tornado.gen.coroutine
    def check_external_portal(self, portid):
        portal = yield motor.Op(self.application.mongodb.portals.find_one,
                                { '_id':portid })
        if not portal:
            raise tornado.web.HTTPError(403, 'No such portal')
        if portal['iid'] is not None:
            raise tornado.web.HTTPError(403, 'Portal is not world-level')
        if portal['scid'] == 'same':
            raise tornado.web.HTTPError(403, 'Portal is current-scope')
        
        plist = yield motor.Op(self.application.mongodb.portlists.find_one,
                               { '_id':portal['plistid'] })
        if not plist:
            raise tornado.web.HTTPError(403, 'No such portlist')
        if plist['type'] != 'world':
            raise tornado.web.HTTPError(403, 'Portlist is not world-level')
        if not plist.get('external', False):
            raise tornado.web.HTTPError(403, 'Portlist is not available for external linking')

        world = yield motor.Op(self.application.mongodb.worlds.find_one,
                               { '_id':portal['wid'] },
                               { 'copyable':1 })
        if not world:
            raise tornado.web.HTTPError(403, 'No such world')
        if not world.get('copyable', False):
            raise tornado.web.HTTPError(403, 'World is not copyable')
        
        return portal
Returns a string representing this endpoint
dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py/MyHandlerMixin.check_external_portal--crossover with--dataset/ETHPy150Open zbyte64/django-hyperadmin/hyperadmin/endpoints.py/BaseEndpoint.get_prompt