모듈:Effective protection level 편집하기

귀하는 로그인되어 있지 않습니다. 이대로 편집하면 귀하의 IP 주소가 편집 기록에 남게 됩니다.

편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.

최신판 당신의 편집
13번째 줄: 13번째 줄:
end
end
pagename = title.prefixedText
pagename = title.prefixedText
if action == 'autoreview' then
if action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
error( 'First parameter must be one of edit, move, create, upload', 2 )
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( '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.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
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
38번째 줄: 28번째 줄:
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]
47번째 줄: 34번째 줄:
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
return 'sysop'
return 'sysop'
elseif level == 'templateeditor' then
return 'templateeditor'
elseif action == 'move' then
elseif action == 'move' then
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 'templateeditor'
return 'sysop'
elseif title.namespace == 6 then
elseif title.namespace == 6 then
return 'filemover'
return 'sysop'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
else
return 'autoconfirmed'
return 'autoconfirmed'
64번째 줄: 47번째 줄:
if blacklistentry then
if blacklistentry then
if not blacklistentry.params.autoconfirmed then
if not blacklistentry.params.autoconfirmed then
return 'templateeditor'
return 'sysop'
elseif level == 'extendedconfirmed' then
return 'extendedconfirmed'
else
else
return 'autoconfirmed'
return 'autoconfirmed'
75번째 줄: 56번째 줄:
return level
return level
elseif action == 'upload' then
elseif action == 'upload' then
return 'autoconfirmed'
return 'uploader'
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 '*'
가온 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 가온 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요!
취소 편집 도움말 (새 창에서 열림)

이 문서에서 사용한 틀: