669
回編集
template>本日晴天 (JAWPの実態に合わせるため、一部変更・コメントアウト) |
Triple-Zeta (トーク | 投稿記録) 細 (4版 をインポートしました) |
||
(2人の利用者による、間の5版が非表示) | |||
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( ' | error( '第1引数には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 'eliminator' -- 英語版では'sysop' | |||
end | end | ||
local level = title.protectionLevels[action] and title.protectionLevels[action][1] | local level = title.protectionLevels[action] and title.protectionLevels[action][1] | ||
61行目: | 64行目: | ||
if blacklistentry then | if blacklistentry then | ||
if not blacklistentry.params.autoconfirmed then | if not blacklistentry.params.autoconfirmed then | ||
return 'templateeditor' | return 'sysop' -- 英語版では'templateeditor' | ||
elseif level == 'extendedconfirmed' then | elseif level == 'extendedconfirmed' then | ||
return 'extendedconfirmed' | return 'extendedconfirmed' |