Anonymer Benutzer
Modul:Effective protection level: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Modul:Effective protection level (Quelltext anzeigen)
Version vom 5. Januar 2021, 21:10 Uhr
, 5. Januar 2021Protected "Module:Effective protection level": High-risk Lua module: To be used in Template:Edit request ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))
(bring in changes from sandbox) |
en>Mdaniels5757 K (Protected "Module:Effective protection level": High-risk Lua module: To be used in Template:Edit request ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))) |
||
| Zeile 23: | Zeile 23: | ||
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review | return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review | ||
end | end | ||
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload | elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then | ||
error( 'First parameter must be one of edit, move, create, upload | error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) | ||
end | end | ||
if title.namespace == 8 then -- MediaWiki namespace | if title.namespace == 8 then -- MediaWiki namespace | ||
if | if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page | ||
return 'interfaceadmin' | return 'interfaceadmin' | ||
else -- any non-JS/CSS MediaWiki page | else -- any non-JS/CSS MediaWiki page | ||
| Zeile 38: | Zeile 38: | ||
return 'sysop' | return 'sysop' | ||
end | end | ||
end | end | ||
local level = title.protectionLevels[action] and title.protectionLevels[action][1] | local level = title.protectionLevels[action] and title.protectionLevels[action][1] | ||