模組:Salt levels

维基百科,自由的百科全书
文档图示 模块文档[创建]
local p = {};
function p.main()
	local level = mw.title.getCurrentTitle().protectionLevels.create;
	if(level == nil) then 
		return -1;
	end
	if(level[1] == "autoconfirmed") then
		return 0;
	else 
		if(level[1] == "templateeditor") then
			return 1;
		else 
			if(level[1] == "sysop") then
				return 2;
			else
				return -1;
			end;
		end
	end
end
return p;