「モジュール:Effective protection level」を編集中
ナビゲーションに移動
検索に移動
この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
23行目: | 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' then | + | elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then |
− | error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) | + | error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 ) |
end | end | ||
if title.namespace == 8 then -- MediaWiki namespace | if title.namespace == 8 then -- MediaWiki namespace | ||
− | if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page | + | if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or 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 | ||
38行目: | 38行目: | ||
return 'sysop' | return 'sysop' | ||
end | end | ||
+ | end | ||
+ | if action == 'undelete' then | ||
+ | return 'sysop' | ||
end | end | ||
local level = title.protectionLevels[action] and title.protectionLevels[action][1] | local level = title.protectionLevels[action] and title.protectionLevels[action][1] | ||
51行目: | 54行目: | ||
return 'templateeditor' | return 'templateeditor' | ||
elseif title.namespace == 6 then | elseif title.namespace == 6 then | ||
− | return | + | return 'filemover' |
elseif level == 'extendedconfirmed' then | elseif level == 'extendedconfirmed' then | ||
return 'extendedconfirmed' | return 'extendedconfirmed' | ||
73行目: | 76行目: | ||
elseif action == 'upload' then | elseif action == 'upload' then | ||
return 'autoconfirmed' | return 'autoconfirmed' | ||
− | + | elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts | |
− | + | return 'user' | |
− | |||
else | else | ||
return '*' | return '*' |