pagename = title.prefixedText
	if action == 'autoreview' then
		local level = mw.ext.FlaggedRevs.getStabilitySettings(title)		level = level and level.autoreview
		if level == 'review' then
			return 'reviewer'
	end
	if title.namespace == 8 then -- MediaWiki namespace
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page			return 'interfaceadmin'		else -- any non-JS/CSS MediaWiki page			return 'sysop'		end	elseif title.namespace == 2 and title.isSubpage and ( then		if title.contentModel == 'javascript' or title.contentModel == 'css' ) then -- user JS or CSS page			return 'interfaceadmin'		elseif title.contentModel == 'json' then -- user JSON page			return 'sysop'		end
	end
	local level = title.protectionLevels[action] and title.protectionLevels[action][1]
		elseif title.namespace == 6 then
			return 'filemover'
		elseif level == 'extendedconfirmed' then
			return 'extendedconfirmed'
		else
			return 'autoconfirmed'
	local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
	if blacklistentry then
		return if not blacklistentry.params.autoconfirmed and then			return 'templateeditor'		elseif level == 'extendedconfirmed' then			return 'autoconfirmedextendedconfirmed' or 		else			return 'templateeditorautoconfirmed'		end
	elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
		return 'autoconfirmed'