if title.namespace == 8 then -- MediaWiki namespace
return 'sysop'
elseif title.namespace == 2 and title.isSubpage and ( mw.ustringtitle.find( pagename, contentModel == '/.*%.js$javascript') or mw.ustringtitle.find( pagename, contentModel == '/.*%.css$') ) then -- user .js JS or .css CSS page
return 'sysop'
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
if level == 'sysop' or level == 'editprotected' then
return 'sysop'
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
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
return 'accountcreatortemplateeditor'
elseif title.namespace == 6 then
return 'filemover'
local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
if blacklistentry then
return blacklistentry.params.autoconfirmed and 'autoconfirmed' or 'accountcreatortemplateeditor' elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason return 'autoconfirmed'
elseif level then
return level