'Retrieve the current permission settings for `page`'

@require_oauth2_scope('modwiki')
@api_doc(api_section.wiki, uri='/wiki/settings/{page}', uses_site=True)
@validate(page=VWikiPage('page', restricted=True, modonly=True))
def GET_wiki_settings(self, page):

    settings = {'permlevel': page._get('permlevel', 0), 'listed': page.listed}
    VNotInTimeout().run(action_name='pageview', details_text='wikisettings', target=page)
    mayedit = page.get_editor_accounts()
    restricted = ((not page.special) and page.restricted)
    show_editors = (not restricted)
    return WikiSettings(settings, mayedit, show_settings=(not page.special), page=page.name, show_editors=show_editors, restricted=restricted, may_revise=True).render()
