匿名利用者
“モジュール:Effective protection level” のwerson間の差分
モジュール:Effective protection level (Ipemoto a=nukar)
2021 ppm 10 2021-10-20T20:26:00+00:00up 20 312021 (Wak.) 20:26時点におけるwerson
、 2021 ppm 10 2021-10-20T20:26:00+00:00up 20 312021 (Wak.)「モジュール:Effective protection level」を保護しました: 影響が特に大きいテンプレート: 使用数9,300 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限))
(ep from enwiki r980896975) |
細 (「モジュール:Effective protection level」を保護しました: 影響が特に大きいテンプレート: 使用数9,300 ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限))) |
||
13行目: | 13行目: | ||
end | end | ||
pagename = title.prefixedText | pagename = title.prefixedText | ||
if action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then | if action == 'autoreview' then | ||
error( ' | local level = mw.ext.FlaggedRevs.getStabilitySettings(title) | ||
level = level and level.autoreview | |||
if level == 'review' then | |||
return 'reviewer' | |||
elseif level ~= '' then | |||
return level | |||
else | |||
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 | |||
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then | |||
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 | ||
30行目: | 40行目: | ||
end | end | ||
if action == 'undelete' then | if action == 'undelete' then | ||
return 'sysop' | 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] | ||
42行目: | 52行目: | ||
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 ' | return 'templateeditor' | ||
elseif title.namespace == 6 then | elseif title.namespace == 6 then | ||
return 'filemover' | return 'eliminator' -- 英語版では'filemover' | ||
elseif level == 'extendedconfirmed' then | elseif level == 'extendedconfirmed' then | ||
return 'extendedconfirmed' | return 'extendedconfirmed' | ||
54行目: | 64行目: | ||
if blacklistentry then | if blacklistentry then | ||
if not blacklistentry.params.autoconfirmed then | if not blacklistentry.params.autoconfirmed then | ||
return 'sysop' | return 'sysop' -- 英語版では'templateeditor' | ||
elseif level == 'extendedconfirmed' then | elseif level == 'extendedconfirmed' then | ||
return 'extendedconfirmed' | return 'extendedconfirmed' | ||
66行目: | 76行目: | ||
elseif action == 'upload' then | elseif action == 'upload' then | ||
return 'autoconfirmed' | return 'autoconfirmed' | ||
-- 英語版とは異なり、日本語版では現在のところIPユーザーでも記事等を作成可能なので、以下はコメントアウト | |||
-- 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 '*' |