Jump to content

Module:Protection banner: Difference between revisions

rm unnecessary do/end blocks
(make the banner in charge of setting its own fields)
(rm unnecessary do/end blocks)
Line 72: Line 72:


-- Set action
-- Set action
do
if not args.action then
if not args.action then
self.action = 'edit'
self.action = 'edit'
elseif self.supportedActions[args.action] then
elseif self.supportedActions[args.action] then
self.action = args.action
self.action = args.action
else
else
error('Unsupported action ' .. args.action, 2)
error('Unsupported action ' .. args.action, 2)
end
end
end


-- Set level
-- Set level
do
self.level = effectiveProtectionLevel(self.action, self.title)
self.level = effectiveProtectionLevel(self.action, self.title)
if self.level == 'accountcreator' then
if self.level == 'accountcreator' then
-- Lump titleblacklisted pages in with template-protected pages,
-- Lump titleblacklisted pages in with template-protected pages,
-- since templateeditors can do both.
-- since templateeditors can do both.
self.level = 'templateeditor'
self.level = 'templateeditor'
elseif not self.level or (self.action == 'move' and self.level == 'autoconfirmed') then
elseif not self.level or (self.action == 'move' and self.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
-- semi-move-protected pages as unprotected.
self.level = '*'
self.level = '*'
end
end
end


Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.