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 | ||
if not args.action then | |||
self.action = 'edit' | |||
elseif self.supportedActions[args.action] then | |||
self.action = args.action | |||
else | |||
error('Unsupported action ' .. args.action, 2) | |||
end | end | ||
-- Set level | -- Set level | ||
self.level = effectiveProtectionLevel(self.action, self.title) | |||
if self.level == 'accountcreator' then | |||
-- Lump titleblacklisted pages in with template-protected pages, | |||
-- since templateeditors can do both. | |||
self.level = 'templateeditor' | |||
elseif not self.level or (self.action == 'move' and self.level == 'autoconfirmed') then | |||
-- Users need to be autoconfirmed to move pages anyway, so treat | |||
-- semi-move-protected pages as unprotected. | |||
self.level = '*' | |||
end | end | ||