模組:Salt levels
模块文档[创建]
您可能想要创建本Scribunto模块的文档。 编者可以在本模块的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模块的子页面。 |
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;