<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.juanweixianshe.com/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AEffective_protection_level</id>
	<title>模块:Effective protection level - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.juanweixianshe.com/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AEffective_protection_level"/>
	<link rel="alternate" type="text/html" href="https://wiki.juanweixianshe.com/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_level&amp;action=history"/>
	<updated>2026-04-11T15:22:12Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.juanweixianshe.com/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_level&amp;diff=186&amp;oldid=prev</id>
		<title>黯狐：导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://wiki.juanweixianshe.com/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_level&amp;diff=186&amp;oldid=prev"/>
		<updated>2021-08-04T09:34:55Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the permission required to perform a given action on a given title.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == 'table' and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then&lt;br /&gt;
		error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )&lt;br /&gt;
	end&lt;br /&gt;
	if title.namespace == 8 then -- MediaWiki namespace&lt;br /&gt;
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		else -- any non-JS/CSS MediaWiki page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	elseif title.namespace == 2 and title.isSubpage then&lt;br /&gt;
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		elseif title.contentModel == 'json' then -- user JSON page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local level = title.protectionLevels[action] and title.protectionLevels[action][1]&lt;br /&gt;
	if level == 'sysop' or level == 'editprotected' then&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif title.cascadingProtection.restrictions['edit'] and title.cascadingProtection.restrictions['edit'][1] then -- used by a cascading-protected page&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif level == 'templateeditor' then&lt;br /&gt;
		return 'templateeditor'&lt;br /&gt;
	elseif action == 'move' then&lt;br /&gt;
		local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.&lt;br /&gt;
		if blacklistentry and not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		elseif title.namespace == 6 then&lt;br /&gt;
			return 'filemover'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)&lt;br /&gt;
	if blacklistentry then&lt;br /&gt;
		if not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	elseif level then&lt;br /&gt;
		return level&lt;br /&gt;
	elseif action == 'upload' then&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	else&lt;br /&gt;
		return '*'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>黯狐</name></author>
	</entry>
</feed>