Module:Effective protection level: Difference between revisions

m
1 revision
m (1 revision)
 
m (1 revision)
(One intermediate revision by the same user not shown)
Line 31: Line 31:
end
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' then
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
Line 40: Line 40:
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.
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.
if blacklistentry and not blacklistentry.params.autoconfirmed then
if blacklistentry and not blacklistentry.params.autoconfirmed then
return 'accountcreator'
return 'templateeditor'
elseif title.namespace == 6 then
elseif title.namespace == 6 then
return 'filemover'
return 'filemover'
Line 49: Line 49:
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
if blacklistentry then
return blacklistentry.params.autoconfirmed and 'autoconfirmed' or 'accountcreator'
return blacklistentry.params.autoconfirmed and 'autoconfirmed' or 'templateeditor'
elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
return 'autoconfirmed'
elseif level then
elseif level then
return level
return level
14,061

edits