Module:Protection banner: Difference between revisions
Content added Content deleted
m (1 revision imported from w:en:Module:Protection_banner) |
Enwikipedia>Mr. Stradivarius (add support for upload protection, and make some formatting tweaks) |
||
Line 74: | Line 74: | ||
while true do |
while true do |
||
-- Can't use pairs() since we're adding and removing things as we're iterating |
-- Can't use pairs() since we're adding and removing things as we're iterating |
||
local k = next(toWalk) |
local k = next(toWalk) -- This always gets the "first" key |
||
if k == nil then break end |
if k == nil then break end |
||
toWalk[k] = nil |
toWalk[k] = nil |
||
Line 97: | Line 97: | ||
edit = true, |
edit = true, |
||
move = true, |
move = true, |
||
autoreview = true |
autoreview = true, |
||
upload = true |
|||
} |
} |
||
Line 874: | Line 875: | ||
local ret = {} |
local ret = {} |
||
-- If a page's edit protection is equally or more restrictive than its |
-- If a page's edit protection is equally or more restrictive than its |
||
-- then don't bother displaying anything |
-- protection from some other action, then don't bother displaying anything |
||
-- for the other action (except categories). |
|||
if protectionObj.action == 'edit' or args.demolevel or not walkHierarchy(cfg.hierarchy, protectionObj.level)[effectiveProtectionLevel('edit', protectionObj.title)] then |
|||
if protectionObj.action == 'edit' or |
|||
args.demolevel or |
|||
not walkHierarchy( |
|||
cfg.hierarchy, |
|||
protectionObj.level |
|||
)[effectiveProtectionLevel('edit', protectionObj.title)] |
|||
then |
|||
-- Initialise the blurb object |
-- Initialise the blurb object |
||
local blurbObj = Blurb.new(protectionObj, args, cfg) |
local blurbObj = Blurb.new(protectionObj, args, cfg) |