Content deleted Content added
Jackmcbarn (talk | contribs) |
Jackmcbarn (talk | contribs) use new module |
||
Line 3:
local getPagetype = require('Module:Pagetype')._main
local makeMessageBox = require('Module:Message box').main
local effectiveProtectionLevel = require('Module:Effective protection level').main
----------------------------------------------------------------------
Line 34 ⟶ 35:
local success, obj = pcall(mw.title.new, ...)
if not (success and obj) then return end
if level == '' then -- Make unprotected pages return "unprotected" rather than the blank string.▼
level = 'unprotected'▼
end▼
-- Add a protectionLevel property.
obj.protectionLevel = effectiveProtectionLevel('
obj.protectionLevel = 'sysop'▼
▲ elseif obj.exists then
else
obj.protectionLevel =
-- Unprotected pages that don't exist get treated as semi-protected, so that requests to create pages don't get flagged as having the wrong protection level
-- Unregistered users can create talk pages (odd numbered namespaces) and drafts (namespace 118), so exclude them
if obj.protectionLevel == '
obj.protectionLevel = 'autoconfirmed'
end
end
|