'Lock a link.
Prevents a post from receiving new comments.
See also: [/api/unlock](#POST_api_unlock).'

@require_oauth2_scope('modposts')
@noresponse(VUser(), VModhash(), VSrCanBan('id'), thing=VByName('id', thing_cls=Link))
@api_doc(api_section.links_and_comments)
def POST_lock(self, thing):

    if thing.archived_slow:
        return abort(400, 'Bad    Request')
    VNotInTimeout().run(action_name='lock', target=thing)
    thing.locked = True
    thing._commit()
    ModAction.create(thing.subreddit_slow, c.user, target=thing, action='lock')
